Class ArrayBuilders
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.util.ArrayBuilders
Helper class that contains set of distinct builders for different
arrays of primitive values. It also provides trivially simple
reuse scheme, which assumes that caller knows not to use instances
concurrently (which works ok with primitive arrays since they can
not contain other non-primitive types).
Also note that instances are not thread safe; the intent is that
a builder is constructed on per-call (deserialization) basis.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
static final class
static final class
static final class
static final class
static final class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> HashSet<T>
arrayToSet
(T[] elements) static Object
getArrayComparator
(Object defaultValue) Helper method used for constructing simple value comparator used for comparing arrays for content equality.static <T> T[]
insertInListNoDup
(T[] array, T element) Helper method for constructing a new array that contains specified element followed by contents of the given array but never contains duplicates.
-
Constructor Details
-
ArrayBuilders
public ArrayBuilders()
-
-
Method Details
-
getBooleanBuilder
-
getByteBuilder
-
getShortBuilder
-
getIntBuilder
-
getLongBuilder
-
getFloatBuilder
-
getDoubleBuilder
-
getArrayComparator
Helper method used for constructing simple value comparator used for comparing arrays for content equality.Note: current implementation is not optimized for speed; if performance ever becomes an issue, it is possible to construct much more efficient typed instances (one for Object[] and sub-types; one per primitive type).
- Since:
- 2.2 Moved from earlier
Comparators
class
-
arrayToSet
-
insertInListNoDup
public static <T> T[] insertInListNoDup(T[] array, T element) Helper method for constructing a new array that contains specified element followed by contents of the given array but never contains duplicates. If element already existed, one of two things happens: if the element was already the first one in array, array is returned as is; but if not, a new copy is created in which element has moved as the head.
-