Package org.javers.core.metamodel.type
Class EnumerableType
- java.lang.Object
-
- org.javers.core.metamodel.type.JaversType
-
- org.javers.core.metamodel.type.EnumerableType
-
- Direct Known Subclasses:
ContainerType
,KeyValueType
public abstract class EnumerableType extends JaversType
Collection or Array or Map
-
-
Field Summary
-
Fields inherited from class org.javers.core.metamodel.type.JaversType
DEFAULT_TYPE_PARAMETER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canBePrototype()
abstract java.lang.Object
empty()
<T> java.util.List<T>
filterToList(java.lang.Object source, java.lang.Class<T> filter)
Returns a new, unmodifiable Enumerable with filtered items, nulls are omitted.java.lang.Class
getBaseJavaClass()
abstract java.lang.Class<?>
getEnumerableInterface()
protected java.lang.reflect.Type
getRawDehydratedType()
Type for JSON representation.abstract boolean
isEmpty(java.lang.Object container)
boolean
isInstance(java.lang.Object cdo)
protected abstract java.util.stream.Stream<java.lang.Object>
items(java.lang.Object source)
java.lang.Object
map(java.lang.Object sourceEnumerable, java.util.function.Function mapFunction)
Returns a new Enumerable (unmodifiable when possible) with items from sourceEnumerable mapped by mapFunction.abstract java.lang.Object
map(java.lang.Object sourceEnumerable, java.util.function.Function mapFunction, boolean filterNulls)
abstract java.lang.Object
map(java.lang.Object sourceEnumerable, EnumerableFunction mapFunction, OwnerContext owner)
OwnerContext aware version ofmap(Object, EnumerableFunction, OwnerContext)
-
Methods inherited from class org.javers.core.metamodel.type.JaversType
equals, equals, getBaseJavaType, getConcreteClassTypeArguments, getName, hashCode, isGenericType, prettyPrint, prettyPrintBuilder, toString
-
-
-
-
Method Detail
-
map
public abstract java.lang.Object map(java.lang.Object sourceEnumerable, EnumerableFunction mapFunction, OwnerContext owner)
OwnerContext aware version ofmap(Object, EnumerableFunction, OwnerContext)
- Returns:
- immutable Enumerable
-
getEnumerableInterface
public abstract java.lang.Class<?> getEnumerableInterface()
-
map
public java.lang.Object map(java.lang.Object sourceEnumerable, java.util.function.Function mapFunction)
Returns a new Enumerable (unmodifiable when possible) with items from sourceEnumerable mapped by mapFunction.
-
map
public abstract java.lang.Object map(java.lang.Object sourceEnumerable, java.util.function.Function mapFunction, boolean filterNulls)
-
isEmpty
public abstract boolean isEmpty(java.lang.Object container)
-
empty
public abstract java.lang.Object empty()
-
filterToList
public <T> java.util.List<T> filterToList(java.lang.Object source, java.lang.Class<T> filter)
Returns a new, unmodifiable Enumerable with filtered items, nulls are omitted.
-
items
protected abstract java.util.stream.Stream<java.lang.Object> items(java.lang.Object source)
-
canBePrototype
public boolean canBePrototype()
- Specified by:
canBePrototype
in classJaversType
-
isInstance
public boolean isInstance(java.lang.Object cdo)
- Specified by:
isInstance
in 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()
-
-