public class StructureUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
clone(T object)
Clone given object if it can be, otherwise the given object is returned.
|
static Map<FieldSpecification,Object> |
createFieldsMap(StructureSpecification spec,
Object[] values)
Creates "Fields Map" for
Structure.toFieldsMap(). |
static <T extends Structure> |
fixEmptyStructureArrayType(Class<T> clazz,
Variant value)
If the given Variant value is exactly Structure[0] or BigDecimal[0], then this method returns
an empty array of the given Class parameter.
|
static int |
hashCode(Object... objects)
Calculates a hash code for given objects.
|
static boolean |
scalarOrArrayEquals(Object first,
Object second)
Compares the two given objects for equals.
|
public static <T> T clone(T object)
T - this is in order to avoid casts after callsobject - object to clone (null is allowed and returned if given)public static Map<FieldSpecification,Object> createFieldsMap(StructureSpecification spec, Object[] values)
Structure.toFieldsMap(). The given values array size must
exactly match the number of fields of the Structure.public static <T extends Structure> T[] fixEmptyStructureArrayType(Class<T> clazz, Variant value)
clazz - Component class type this method should returnvalue - a Variant with value of correct type or Structure[0] (or BigDecimal[0])ClassCastException - if the Variant contains a value that cannot be casted to correct
type (and is not Structure[0] or BigDecimal[0]).public static int hashCode(Object... objects)
Object.hashCode() of the object for scalars, Arrays.hashCode(Object[])e
for 1-dim arrays and Arrays.deepHashCode(Object[]) for multidim arrays. Multidim arrays
shall not contiain themselvers as elements as per Arrays.deepHashCode(Object[])
documentation.objects - the objectspublic static boolean scalarOrArrayEquals(Object first, Object second)
Arrays.equals(Object[], Object[]) and
multidimensional arrays with Arrays.deepEquals(Object[], Object[]). Multidimensional
arrays shall not contain themselves as elements as per
Arrays.deepEquals(Object[], Object[]) documentation.first - null, scalar or anydimensional array (non-primitive)second - null, scalar or one anydimensional array (non-primitive)Copyright © 2026. All rights reserved.