public static ListValue List(params object[] objects) { AnyValue[] values = new AnyValue[objects.Length]; for (int i = 0; i < objects.Length; i++) { values[i] = ToAnyValue(objects[i]); } return(VirtualValues.List(values)); }
public virtual ListValue AsList() { NodeValue[] nodes = nodes(); RelationshipValue[] relationships = relationships(); int size = nodes.Length + relationships.Length; AnyValue[] anyValues = new AnyValue[size]; for (int i = 0; i < size; i++) { if (i % 2 == 0) { anyValues[i] = nodes[i / 2]; } else { anyValues[i] = relationships[i / 2]; } } return(VirtualValues.List(anyValues)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Parameterized.Parameters(name = "{0}") public static Iterable<WriteTest> data() public static IEnumerable <WriteTest> Data() { return(Arrays.asList(ShouldWrite(VirtualValues.List(booleanValue(false), byteArray(new sbyte[] { 3, 4, 5 }), stringValue("yo")), beginList(3), false, Specials.byteArray(new sbyte[] { 3, 4, 5 }), "yo", endList()), ShouldWrite(VirtualValues.Map(new string[] { "foo", "bar" }, new AnyValue[] { intValue(100), charValue('c') }), beginMap(2), "bar", 'c', "foo", 100, endMap()), ShouldWrite(VirtualValues.Node(1L), writeNodeReference(1L)), ShouldWrite(relationship(2L), writeRelationshipReference(2L)), ShouldWrite(VirtualValues.Path(new NodeValue[] { nodeValue(20L, stringArray("L"), emptyMap()), nodeValue(40L, stringArray("L"), emptyMap()) }, new RelationshipValue[] { relationshipValue(100L, nodeValue(40L, stringArray("L"), emptyMap()), nodeValue(20L, stringArray("L"), emptyMap()), stringValue("T"), emptyMap()) }), writePath(new NodeValue[] { nodeValue(20L, stringArray("L"), emptyMap()), nodeValue(40L, stringArray("L"), emptyMap()) }, new RelationshipValue[] { relationshipValue(100L, nodeValue(40L, stringArray("L"), emptyMap()), nodeValue(20L, stringArray("L"), emptyMap()), stringValue("T"), emptyMap()) })), ShouldWrite(VirtualValues.Map(new string[] { "foo" }, new AnyValue[] { VirtualValues.List(VirtualValues.Map(new string[] { "bar" }, new AnyValue[] { VirtualValues.List() })) }), beginMap(1), "foo", beginList(1), beginMap(1), "bar", beginList(0), endList(), endMap(), endList(), endMap()), ShouldWrite(nodeValue(1337L, stringArray("L1", "L2"), map(new string[] { "foo" }, new AnyValue[] { stringValue("foo") })), writeNode(1337L, stringArray("L1", "L2"), map(new string[] { "foo" }, new AnyValue[] { stringValue("foo") }))), ShouldWrite(relationshipValue(1337L, nodeValue(42L, stringArray("L"), emptyMap()), nodeValue(43L, stringArray("L"), emptyMap()), stringValue("T"), map(new string[] { "foo" }, new AnyValue[] { stringValue("foo") })), writeRelationship(1337L, 42L, 43L, stringValue("T"), map(new string[] { "foo" }, new AnyValue[] { stringValue("foo") }))))); }