Package org.javers.core.metamodel.type
Class ArrayType
- java.lang.Object
-
- org.javers.core.metamodel.type.JaversType
-
- org.javers.core.metamodel.type.EnumerableType
-
- org.javers.core.metamodel.type.ContainerType
-
- org.javers.core.metamodel.type.ArrayType
-
public class ArrayType extends ContainerType
-
-
Field Summary
-
Fields inherited from class org.javers.core.metamodel.type.JaversType
DEFAULT_TYPE_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description ArrayType(java.lang.reflect.Type baseJavaType, TypeMapperLazy typeMapperLazy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBePrototype()java.lang.Objectempty()booleanequals(java.lang.Object one, java.lang.Object two)Used for comparing as Valuesjava.lang.ClassgetBaseJavaClass()java.util.List<java.lang.reflect.Type>getConcreteClassTypeArguments()For generic types, returns a list of actual Class arguments.java.lang.Class<?>getEnumerableInterface()protected java.lang.reflect.TypegetRawDehydratedType()Type for JSON representation.booleanisEmpty(java.lang.Object array)booleanisInstance(java.lang.Object cdo)protected java.util.stream.Stream<java.lang.Object>items(java.lang.Object source)java.lang.Objectmap(java.lang.Object sourceArray, java.util.function.Function mapFunction, boolean filterNulls)java.lang.Objectmap(java.lang.Object sourceArray, EnumerableFunction mapFunction, OwnerContext owner)OwnerContext aware version ofEnumerableType.map(Object, EnumerableFunction, OwnerContext)-
Methods inherited from class org.javers.core.metamodel.type.ContainerType
getItemClass, getItemJavaType, getItemJaversType
-
Methods inherited from class org.javers.core.metamodel.type.EnumerableType
filterToList, getTypeMapperLazy, map, spawnConstructorArgs, spawnConstructorArgTypes
-
Methods inherited from class org.javers.core.metamodel.type.JaversType
equals, getBaseJavaType, getName, hashCode, isGenericType, prettyPrint, prettyPrintBuilder, toString
-
-
-
-
Constructor Detail
-
ArrayType
public ArrayType(java.lang.reflect.Type baseJavaType, TypeMapperLazy typeMapperLazy)
-
-
Method Detail
-
getConcreteClassTypeArguments
public java.util.List<java.lang.reflect.Type> getConcreteClassTypeArguments()
Description copied from class:JaversTypeFor generic types, returns a list of actual Class arguments. For example, for Set<String>, returns String. Non-concrete (like ?) or missing type arguments like are defaulted to Object.
For array, returns List withClass.getComponentType()- Overrides:
getConcreteClassTypeArgumentsin classJaversType
-
map
public java.lang.Object map(java.lang.Object sourceArray, EnumerableFunction mapFunction, OwnerContext owner)Description copied from class:EnumerableTypeOwnerContext aware version ofEnumerableType.map(Object, EnumerableFunction, OwnerContext)- Specified by:
mapin classEnumerableType- Returns:
- immutable Enumerable
-
isEmpty
public boolean isEmpty(java.lang.Object array)
- Specified by:
isEmptyin classEnumerableType
-
map
public java.lang.Object map(java.lang.Object sourceArray, java.util.function.Function mapFunction, boolean filterNulls)- Specified by:
mapin classEnumerableType
-
items
protected java.util.stream.Stream<java.lang.Object> items(java.lang.Object source)
- Specified by:
itemsin classEnumerableType
-
equals
public boolean equals(java.lang.Object one, java.lang.Object two)Description copied from class:JaversTypeUsed for comparing as Values- Overrides:
equalsin classJaversType
-
empty
public java.lang.Object empty()
- Specified by:
emptyin classEnumerableType
-
getEnumerableInterface
public java.lang.Class<?> getEnumerableInterface()
- Specified by:
getEnumerableInterfacein classEnumerableType
-
canBePrototype
public boolean canBePrototype()
- Specified by:
canBePrototypein classJaversType
-
isInstance
public boolean isInstance(java.lang.Object cdo)
- Specified by:
isInstancein classJaversType
-
getRawDehydratedType
protected java.lang.reflect.Type getRawDehydratedType()
Type for JSON representation. For Values it's simply baseJavaType. For ManagedTypes (references to Entities and ValueObjects) it's GlobalId because JaVers serializes references in the 'dehydrated' form.
-
getBaseJavaClass
public java.lang.Class getBaseJavaClass()
-
-