Class JulieNeo4jUtilities
- java.lang.Object
-
- de.julielab.neo4j.plugins.auxiliaries.JulieNeo4jUtilities
-
public class JulieNeo4jUtilities extends Object
-
-
Constructor Summary
Constructors Constructor Description JulieNeo4jUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object[]convertArray(Object value)Converts value to its correct runtime array type.static Object[]convertElementsIntoArray(Class<?> cls, Object... elements)Converts elements into an array of the runtime type cls .static <T> T[]convertListToArray(List<T> list, Class<?> cls)static <T> intfindFirstValueInArray(T[] array, T value)Expects an array that is filled with value from the right and returns the index of the first entry that equals value in the array performing a binary search.
-
-
-
Method Detail
-
convertElementsIntoArray
public static Object[] convertElementsIntoArray(Class<?> cls, Object... elements)
Converts elements into an array of the runtime type cls .- Parameters:
cls-elements-- Returns:
-
convertArray
public static Object[] convertArray(Object value)
Converts value to its correct runtime array type. Requires that value is an array of a Java base type (String, int, Double etc).- Parameters:
value- The array expressed as an object- Returns:
- The same array but cast to the correct runtime element type.
-
findFirstValueInArray
public static <T> int findFirstValueInArray(T[] array, T value)Expects an array that is filled with value from the right and returns the index of the first entry that equals value in the array performing a binary search. Returns -1 if the value was found.- Parameters:
array-- Returns:
-
-