@Test public void testToSet() throws Exception { testCall(db, "return apoc.convert.toSet($a) as value", map("a", null), r -> assertEquals(null, r.get("value"))); testCall(db, "return apoc.convert.toSet($a) as value", map("a", new Object[]{"a"}), r -> assertEquals(singletonList("a"), r.get("value"))); testCall(db, "return apoc.convert.toSet($a) as value", map("a", singleton("a")), r -> assertEquals(singletonList("a"), r.get("value"))); testCall(db, "return apoc.convert.toSet($a) as value", map("a", singletonList("a")), r -> assertEquals(singletonList("a"), r.get("value"))); testCall(db, "return apoc.convert.toSet($a) as value", map("a", singletonList("a").iterator()), r -> assertEquals(singletonList("a"), r.get("value"))); }
@SuppressWarnings("unchecked") @UserFunction @Description("apoc.convert.toSet(value) | tries it's best to convert the value to a set") public List<Object> toSet(@Name("list") Object value) { List list = convertToList(value); return list == null ? null : new SetBackedList(new LinkedHashSet<>(list)); }
Convert { @SuppressWarnings("unchecked") @UserFunction @Description("apoc.convert.toSet(value) | tries it's best to convert the value to a set") public List<Object> toSet(@Name("list") Object value) { List list = convertToList(value); return list == null ? null : new SetBackedList(new LinkedHashSet<>(list)); } }
Convert { @SuppressWarnings("unchecked") @UserFunction @Description("apoc.convert.toSet(value) | tries it's best to convert the value to a set") public List<Object> toSet(@Name("list") Object value) { List list = convertToList(value); return list == null ? null : new SetBackedList(new LinkedHashSet<>(list)); }  }
Convert { @SuppressWarnings("unchecked") @UserFunction @Description("apoc.convert.toSet(value) | tries it's best to convert the value to a set") public List<Object> toSet(@Name("list") Object value) { List list = convertToList(value); return list == null ? null : new SetBackedList(new LinkedHashSet<>(list)); }  @UserFunction @Description("apoc.convert.toMap(value) | tries it's best to convert the value to a map") Map<String, Object> toMap(@Name("map") Object map); @UserFunction @Description("apoc.convert.toString(value) | tries it's best to convert the value to a string") String toString(@Name("string") Object string); @UserFunction @Description("apoc.convert.toList(value) | tries it's best to convert the value to a list") List<Object> toList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toBoolean(value) | tries it's best to convert the value to a boolean") Boolean toBoolean(@Name("bool") Object bool); @UserFunction @Description("apoc.convert.toNode(value) | tries it's best to convert the value to a node") Node toNode(@Name("node") Object node); @UserFunction @Description("apoc.convert.toRelationship(value) | tries it's best to convert the value to a relationship") Relationship toRelationship(@Name("relationship") Object relationship); @SuppressWarnings("unchecked") @UserFunction @Description("apoc.convert.toSet(value) | tries it's best to convert the value to a set") List<Object> toSet(@Name("list") Object value); @UserFunction @Description("apoc.convert.toIntList(value) | tries it's best to convert " + "the value to a list of integers") List<Long> toIntList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toStringList(value) | tries it's best to convert " + "the value to a list of strings") List<String> toStringList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toBooleanList(value) | tries it's best to convert " + "the value to a list of booleans") List<Boolean> toBooleanList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toNodeList(value) | tries it's best to convert " + "the value to a list of nodes") List<Node> toNodeList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toRelationshipList(value) | tries it's best to convert " + "the value to a list of relationships") List<Relationship> toRelationshipList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toInteger(value) | tries it's best to convert the value to an integer") Long toInteger(@Name("object") Object obj); @UserFunction @Description("apoc.convert.toFloat(value) | tries it's best to convert the value to a float") Double toFloat(@Name("object") Object obj); }
Convert { @SuppressWarnings("unchecked") @UserFunction @Description("apoc.convert.toSet(value) | tries it's best to convert the value to a set") public List<Object> toSet(@Name("list") Object value) { List list = convertToList(value); return list == null ? null : new SetBackedList(new LinkedHashSet<>(list)); }  @UserFunction @Description("apoc.convert.toMap(value) | tries it's best to convert the value to a map") Map<String, Object> toMap(@Name("map") Object map); @UserFunction @Description("apoc.convert.toString(value) | tries it's best to convert the value to a string") String toString(@Name("string") Object string); @UserFunction @Description("apoc.convert.toList(value) | tries it's best to convert the value to a list") List<Object> toList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toBoolean(value) | tries it's best to convert the value to a boolean") Boolean toBoolean(@Name("bool") Object bool); @UserFunction @Description("apoc.convert.toNode(value) | tries it's best to convert the value to a node") Node toNode(@Name("node") Object node); @UserFunction @Description("apoc.convert.toRelationship(value) | tries it's best to convert the value to a relationship") Relationship toRelationship(@Name("relationship") Object relationship); @SuppressWarnings("unchecked") @UserFunction @Description("apoc.convert.toSet(value) | tries it's best to convert the value to a set") List<Object> toSet(@Name("list") Object value); @UserFunction @Description("apoc.convert.toIntList(value) | tries it's best to convert " + "the value to a list of integers") List<Long> toIntList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toStringList(value) | tries it's best to convert " + "the value to a list of strings") List<String> toStringList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toBooleanList(value) | tries it's best to convert " + "the value to a list of booleans") List<Boolean> toBooleanList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toNodeList(value) | tries it's best to convert " + "the value to a list of nodes") List<Node> toNodeList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toRelationshipList(value) | tries it's best to convert " + "the value to a list of relationships") List<Relationship> toRelationshipList(@Name("list") Object list); @UserFunction @Description("apoc.convert.toInteger(value) | tries it's best to convert the value to an integer") Long toInteger(@Name("object") Object obj); @UserFunction @Description("apoc.convert.toFloat(value) | tries it's best to convert the value to a float") Double toFloat(@Name("object") Object obj); @Context
    public Log log; }