public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { DateTimeOffset value = objectData; var ticks = (value - UnixStart).Ticks; return(GraphSONUtil.ToTypedValue("Date", ticks / TimeSpan.TicksPerMillisecond)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { var enumName = objectData.GetType().Name; var valueJavaName = NamingConversions.GetEnumJavaName(enumName, objectData.ToString()); return(GraphSONUtil.ToTypedValue(enumName, valueJavaName)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { object value = objectData; if (StringifyValue) { value = string.Format(CultureInfo.InvariantCulture, "{0}", value); } return(GraphSONUtil.ToTypedValue(GraphSONTypeName, value, Prefix)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { object value = objectData; if (StringifyValue) { value = value?.ToString(); } return(GraphSONUtil.ToTypedValue(GraphSONTypeName, value, Prefix)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { Vertex vertex = objectData; var vertexDict = new Dictionary <string, dynamic> { { "id", writer.ToDict(vertex.Id) }, { "label", writer.ToDict(vertex.Label) } }; return(GraphSONUtil.ToTypedValue(nameof(Vertex), vertexDict)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { var binding = (Binding)objectData; var valueDict = new Dictionary <string, object> { { "value", writer.ToDict(binding.Value) }, { "key", binding.Key } }; return(GraphSONUtil.ToTypedValue(nameof(Binding), valueDict)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { ILambda lambda = objectData; var valueDict = new Dictionary <string, dynamic> { { "script", lambda.LambdaExpression }, { "language", lambda.Language }, { "arguments", lambda.Arguments } }; return(GraphSONUtil.ToTypedValue(nameof(Lambda), valueDict)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { Property property = objectData; var elementDict = CreateElementDict(property.Element, writer); var valueDict = new Dictionary <string, dynamic> { { "key", property.Key }, { "value", writer.ToDict(property.Value) }, { "element", elementDict } }; return(GraphSONUtil.ToTypedValue(nameof(Property), valueDict)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { VertexProperty vertexProperty = objectData; var valueDict = new Dictionary <string, dynamic> { { "id", writer.ToDict(vertexProperty.Id) }, { "label", vertexProperty.Label }, { "value", writer.ToDict(vertexProperty.Value) }, { "vertex", writer.ToDict(vertexProperty.Vertex.Id) } }; return(GraphSONUtil.ToTypedValue(nameof(VertexProperty), valueDict)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { Edge edge = objectData; var edgeDict = new Dictionary <string, dynamic> { { "id", writer.ToDict(edge.Id) }, { "outV", writer.ToDict(edge.OutV.Id) }, { "outVLabel", edge.OutV.Label }, { "label", edge.Label }, { "inV", writer.ToDict(edge.InV.Id) }, { "inVLabel", edge.InV.Label } }; return(GraphSONUtil.ToTypedValue(nameof(Edge), edgeDict)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { if (!(objectData is IDictionary map)) { throw new InvalidOperationException("Object must implement IDictionary"); } var result = new object[map.Count * 2]; var index = 0; foreach (var key in map.Keys) { result[index++] = writer.ToDict(key); result[index++] = writer.ToDict(map[key]); } return(GraphSONUtil.ToTypedValue("Map", result)); }
public Dictionary <string, dynamic> Dictify(dynamic predicate, GraphSONWriter writer) { TraversalPredicate p = predicate; var value = p.Other == null ? writer.ToDict(p.Value) : new List <dynamic> { writer.ToDict(p.Value), writer.ToDict(p.Other) }; var dict = new Dictionary <string, dynamic> { { "predicate", p.OperatorName }, { "value", value } }; return(GraphSONUtil.ToTypedValue("P", dict)); }
public Dictionary <string, dynamic> Dictify(dynamic bytecodeObj, GraphSONWriter writer) { Bytecode bytecode = bytecodeObj; var valueDict = new Dictionary <string, IEnumerable <IEnumerable <dynamic> > >(); if (bytecode.SourceInstructions.Count > 0) { valueDict["source"] = DictifyInstructions(bytecode.SourceInstructions, writer); } if (bytecode.StepInstructions.Count > 0) { valueDict["step"] = DictifyInstructions(bytecode.StepInstructions, writer); } return(GraphSONUtil.ToTypedValue(nameof(Bytecode), valueDict)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { DateTime dateTime = objectData; return(GraphSONUtil.ToTypedValue("Date", ToJavaTimestamp(dateTime))); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { return(GraphSONUtil.ToTypedValue(GraphSONTypeName, objectData)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { Guid guid = objectData; return(GraphSONUtil.ToTypedValue("UUID", guid)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { AbstractTraversalStrategy strategy = objectData; return(GraphSONUtil.ToTypedValue(strategy.StrategyName, writer.ToDict(strategy.Configuration))); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { DateTimeOffset value = objectData; return(GraphSONUtil.ToTypedValue("Date", value.ToUnixTimeMilliseconds())); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { EnumWrapper enumToSerialize = objectData; return(GraphSONUtil.ToTypedValue(enumToSerialize.EnumName, enumToSerialize.EnumValue)); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { byte[] value = objectData; return(GraphSONUtil.ToTypedValue("ByteBuffer", Convert.ToBase64String(value), "gx")); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { BigInteger value = objectData; return(GraphSONUtil.ToTypedValue("BigInteger", value.ToString(), "gx")); }
public Dictionary <string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { TimeSpan value = objectData; return(GraphSONUtil.ToTypedValue("Duration", XmlConvert.ToString(value), "gx")); }