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
  • Method Details

    • getConcreteClassTypeArguments

      public List<Type> getConcreteClassTypeArguments()
      Description copied from class: JaversType
      For 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 with Class.getComponentType()
      Overrides:
      getConcreteClassTypeArguments in class JaversType
    • spawnConstructorArgs

      protected Object[] spawnConstructorArgs(Type baseJavaType)
      Overrides:
      spawnConstructorArgs in class JaversType
    • spawnConstructorArgTypes

      protected Class[] spawnConstructorArgTypes()
      Overrides:
      spawnConstructorArgTypes in class JaversType
    • getTypeMapperLazy

      protected TypeMapperLazy getTypeMapperLazy()
    • map

      public abstract Object map(Object sourceEnumerable, EnumerableFunction mapFunction, OwnerContext owner)
      OwnerContext aware version of map(Object, EnumerableFunction, OwnerContext)
      Returns:
      immutable Enumerable
    • getEnumerableInterface

      public abstract Class<?> getEnumerableInterface()
    • map

      public Object map(Object sourceEnumerable, Function mapFunction)
      Returns a new Enumerable (unmodifiable when possible) with items from sourceEnumerable mapped by mapFunction.
    • mapPreservingSourceItemType

      public Object mapPreservingSourceItemType(Object sourceEnumerable, Function mapFunction)
      For building Shadows. Item type of new enumerable matters only for arrays
    • map

      public abstract Object map(Object sourceEnumerable, Function mapFunction, boolean filterNulls)
    • isEmpty

      public abstract boolean isEmpty(Object container)
    • empty

      public abstract Object empty()
    • filterToList

      public <T> List<T> filterToList(Object source, Class<T> filter)
      Returns a new, unmodifiable Enumerable with filtered items, nulls are omitted.
    • items

      protected abstract Stream<Object> items(Object source)
    • canBePrototype

      public boolean canBePrototype()
      Specified by:
      canBePrototype in class JaversType
    • isInstance

      public boolean isInstance(Object cdo)
      Specified by:
      isInstance in class JaversType
    • getRawDehydratedType

      protected 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 Class getBaseJavaClass()