Package org.javers.core.metamodel.type
Class KeyValueType
- java.lang.Object
-
- org.javers.core.metamodel.type.JaversType
-
- org.javers.core.metamodel.type.EnumerableType
-
- org.javers.core.metamodel.type.KeyValueType
-
- Direct Known Subclasses:
MapType
,MultimapType
public abstract class KeyValueType extends EnumerableType
-
-
Field Summary
-
Fields inherited from class org.javers.core.metamodel.type.JaversType
DEFAULT_TYPE_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description KeyValueType(java.lang.reflect.Type baseJavaType, int expectedArgs, TypeMapperLazy typeMapperLazy)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canBePrototype()
protected abstract java.util.stream.Stream<java.util.Map.Entry>
entries(java.lang.Object source)
<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()
java.lang.reflect.Type
getKeyJavaType()
never returns nullJaversType
getKeyJaversType()
protected java.lang.reflect.Type
getRawDehydratedType()
Type for JSON representation.java.lang.reflect.Type
getValueJavaType()
never returns nullJaversType
getValueJaversType()
boolean
isInstance(java.lang.Object cdo)
protected java.util.stream.Stream<java.lang.Object>
items(java.lang.Object source)
-
Methods inherited from class org.javers.core.metamodel.type.EnumerableType
empty, getEnumerableInterface, getTypeMapperLazy, isEmpty, map, map, map, spawnConstructorArgs, spawnConstructorArgTypes
-
Methods inherited from class org.javers.core.metamodel.type.JaversType
equals, equals, getBaseJavaType, getConcreteClassTypeArguments, getName, hashCode, isGenericType, prettyPrint, prettyPrintBuilder, toString
-
-
-
-
Constructor Detail
-
KeyValueType
public KeyValueType(java.lang.reflect.Type baseJavaType, int expectedArgs, TypeMapperLazy typeMapperLazy)
-
-
Method Detail
-
getKeyJavaType
public java.lang.reflect.Type getKeyJavaType()
never returns null
-
getValueJavaType
public java.lang.reflect.Type getValueJavaType()
never returns null
-
filterToList
public <T> java.util.List<T> filterToList(java.lang.Object source, java.lang.Class<T> filter)
Description copied from class:EnumerableType
Returns a new, unmodifiable Enumerable with filtered items, nulls are omitted.- Overrides:
filterToList
in classEnumerableType
-
items
protected java.util.stream.Stream<java.lang.Object> items(java.lang.Object source)
- Specified by:
items
in classEnumerableType
-
entries
protected abstract java.util.stream.Stream<java.util.Map.Entry> entries(java.lang.Object source)
-
getValueJaversType
public JaversType getValueJaversType()
-
getKeyJaversType
public JaversType getKeyJaversType()
-
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()
-
-