internal static Representation GetSingleRepresentation(object result) { if (result == null) { return(ValueRepresentation.OfNull()); } else if (result is GraphDatabaseService) { return(new DatabaseRepresentation()); } else if (result is Node) { return(new NodeRepresentation(( Node )result)); } else if (result is Relationship) { return(new RelationshipRepresentation(( Relationship )result)); } else if (result is double? || result is float?) { return(ValueRepresentation.number((( Number )result).doubleValue())); } else if (result is long?) { return(ValueRepresentation.number((( long? )result).Value)); } else if (result is int?) { return(ValueRepresentation.number((( int? )result).Value)); } else if (result is bool?) { return(ValueRepresentation.Bool((( bool? )result).Value)); } else { return(ValueRepresentation.String(result.ToString())); } }
public ValueRepresentation ExtendedEntity() { return(ValueRepresentation.String(ExtendedEntity)); }
public ValueRepresentation StartNodeUri() { return(ValueRepresentation.Uri(NodeRepresentation.Path(_rel.StartNode))); }
public ValueRepresentation PropertyUriTemplate() { return(ValueRepresentation.Template(Path("/properties/{key}"))); }
protected internal override Representation underlyingObjectToObject(Node node) { return(ValueRepresentation.Uri(NodeRepresentation.Path(node))); }
public virtual ValueRepresentation EndNode() { return(ValueRepresentation.Uri(NodeRepresentation.Path(_path.endNode()))); }
protected internal override Representation underlyingObjectToObject(string directionString) { return(ValueRepresentation.String(directionString)); }
public ValueRepresentation AllRelationshipsUri() { return(ValueRepresentation.Uri(Path("/relationships/all"))); }
public static string Serialize(ValueRepresentation repr) { return(Serialize(_baseUri, repr)); }
public virtual ValueRepresentation PasswordChange() { return(ValueRepresentation.Uri(format("/user/%s/password", _user.name()))); }
public virtual ValueRepresentation PasswordChangeRequired() { return(ValueRepresentation.Bool(_user.passwordChangeRequired())); }
public virtual ValueRepresentation User() { return(ValueRepresentation.String(_user.name())); }
private IndexedEntityRepresentation(MappingRepresentation entity, long entityId, string key, string value, IndexRepresentation indexRepresentation) : base(entity.Type) { this._entity = entity; _selfUri = ValueRepresentation.Uri(indexRepresentation.RelativeUriFor(key, value, entityId)); }
protected internal override void Serialize(MappingSerializer serializer) { if (_indexDefinition.NodeIndex) { serializer.PutList("labels", new ListRepresentation(RepresentationType.String, map(label => ValueRepresentation.String(label.name()), _indexDefinition.Labels))); if (!_indexDefinition.MultiTokenIndex) { serializer.PutString("label", single(_indexDefinition.Labels).name()); } } else { serializer.PutList("relationshipTypes", new ListRepresentation(RepresentationType.String, map(relType => ValueRepresentation.String(relType.name()), _indexDefinition.RelationshipTypes))); if (!_indexDefinition.MultiTokenIndex) { serializer.PutString("relationshipType", single(_indexDefinition.RelationshipTypes).name()); } } System.Func <string, Representation> converter = ValueRepresentation.@string; IEnumerable <Representation> propertyKeyRepresentations = map(converter, _indexDefinition.PropertyKeys); serializer.PutList("property_keys", new ListRepresentation(RepresentationType.String, propertyKeyRepresentations)); // Only print state and progress if progress is a valid value and not yet online if (_indexState == Org.Neo4j.Graphdb.schema.Schema_IndexState.Populating) { serializer.PutString("state", _indexState.name()); serializer.PutString("population_progress", string.Format("{0,1:F0}%", _indexPopulationProgress.CompletedPercentage)); } }
public ValueRepresentation PagedTraverseUriTemplate() { return(ValueRepresentation.Template(Path("/paged/traverse/{returnType}{?pageSize,leaseTime}"))); }
public static string Serialize(URI baseUri, ValueRepresentation repr) { return(repr.Serialize(new StringFormat(), baseUri, null)); }
public ValueRepresentation RelationshipCreationUri() { return(ValueRepresentation.Uri(Path("/relationships"))); }
public static Representation Value(object property) { return(ValueRepresentation.Property(property)); }
public ValueRepresentation IncomingRelationshipsUri() { return(ValueRepresentation.Uri(Path("/relationships/in"))); }
public ValueRepresentation OutgoingRelationshipsUri() { return(ValueRepresentation.Uri(Path("/relationships/out"))); }
public virtual ValueRepresentation StartNode() { return(ValueRepresentation.Uri(NodeRepresentation.Path(_path.startNode()))); }
public ValueRepresentation AllTypedRelationshipsUriTemplate() { return(ValueRepresentation.Template(Path("/relationships/all/{-list|&|types}"))); }
public virtual ValueRepresentation Length() { return(ValueRepresentation.Number(_path.length())); }
public ValueRepresentation OutgoingTypedRelationshipsUriTemplate() { return(ValueRepresentation.Template(Path("/relationships/out/{-list|&|types}"))); }
public ValueRepresentation PropertiesUri() { return(ValueRepresentation.Uri(Path("/properties"))); }
public ValueRepresentation LabelsUriTemplate() { return(ValueRepresentation.Template(Path("/labels"))); }
public override ValueRepresentation SelfUri() { return(ValueRepresentation.Uri(Path(""))); }
public ValueRepresentation TraverseUriTemplate() { return(ValueRepresentation.Template(Path("/traverse/{returnType}"))); }
public ValueRepresentation EndNodeUri() { return(ValueRepresentation.Uri(NodeRepresentation.Path(_rel.EndNode))); }
public ValueRepresentation Description() { return(ValueRepresentation.String(_description)); }