Package org.javers.core.metamodel.type
Class CollectionType
- 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.CollectionType
-
- Direct Known Subclasses:
ListAsSetType,ListType,MultisetType,OptionalType,SetType
public class CollectionType extends ContainerType
-
-
Field Summary
-
Fields inherited from class org.javers.core.metamodel.type.JaversType
DEFAULT_TYPE_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description CollectionType(java.lang.reflect.Type baseJavaType, TypeMapperLazy typeMapperLazy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBePrototype()java.lang.Objectempty()java.lang.ClassgetBaseJavaClass()java.lang.Class<?>getEnumerableInterface()protected java.lang.reflect.TypegetRawDehydratedType()Type for JSON representation.booleanisEmpty(java.lang.Object collection)booleanisInstance(java.lang.Object cdo)protected java.util.stream.Stream<java.lang.Object>items(java.lang.Object source)java.lang.Objectmap(java.lang.Object sourceEnumerable, java.util.function.Function mapFunction, boolean filterNulls)java.lang.Objectmap(java.lang.Object sourceEnumerable, EnumerableFunction mapFunction, OwnerContext owner)OwnerContext aware version ofEnumerableType.map(Object, EnumerableFunction, OwnerContext)protected java.lang.ObjectmapToList(java.lang.Object sourceEnumerable, EnumerableFunction mapFunction, OwnerContext owner)protected java.lang.ObjectmapToSet(java.lang.Object sourceEnumerable, EnumerableFunction mapFunction, OwnerContext owner)static java.util.CollectionwrapNull(java.lang.Object col)-
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, mapPreservingSourceItemType, spawnConstructorArgs, spawnConstructorArgTypes
-
Methods inherited from class org.javers.core.metamodel.type.JaversType
equals, equals, getBaseJavaType, getConcreteClassTypeArguments, getName, hashCode, isGenericType, prettyPrint, prettyPrintBuilder, toString
-
-
-
-
Constructor Detail
-
CollectionType
public CollectionType(java.lang.reflect.Type baseJavaType, TypeMapperLazy typeMapperLazy)
-
-
Method Detail
-
isEmpty
public boolean isEmpty(java.lang.Object collection)
- Specified by:
isEmptyin classEnumerableType
-
map
public java.lang.Object map(java.lang.Object sourceEnumerable, EnumerableFunction mapFunction, OwnerContext owner)Description copied from class:EnumerableTypeOwnerContext aware version ofEnumerableType.map(Object, EnumerableFunction, OwnerContext)- Specified by:
mapin classEnumerableType- Returns:
- immutable List
-
mapToList
protected java.lang.Object mapToList(java.lang.Object sourceEnumerable, EnumerableFunction mapFunction, OwnerContext owner)- Returns:
- immutable List
-
mapToSet
protected java.lang.Object mapToSet(java.lang.Object sourceEnumerable, EnumerableFunction mapFunction, OwnerContext owner)- Returns:
- immutable Set
-
map
public java.lang.Object map(java.lang.Object sourceEnumerable, java.util.function.Function mapFunction, boolean filterNulls)- Specified by:
mapin classEnumerableType
-
empty
public java.lang.Object empty()
- Specified by:
emptyin classEnumerableType
-
items
protected java.util.stream.Stream<java.lang.Object> items(java.lang.Object source)
- Specified by:
itemsin classEnumerableType
-
wrapNull
public static java.util.Collection wrapNull(java.lang.Object col)
-
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()
-
-