Module com.legyver.utils.mapqua
Class MapBackedEntityCollection<U extends java.util.Collection<T>,T extends RawMapAware>
- java.lang.Object
-
- com.legyver.utils.mapqua.mapbacked.MapBackedProperty<java.util.Collection>
-
- com.legyver.utils.mapqua.mapbacked.MapBackedCollection<java.util.Collection<T>,T>
-
- com.legyver.utils.mapqua.mapbacked.MapBackedEntityCollection<U,T>
-
- Type Parameters:
U- Type of Collection (ie: List/Set)T- Type of Entity in the Collection
public class MapBackedEntityCollection<U extends java.util.Collection<T>,T extends RawMapAware> extends MapBackedCollection<java.util.Collection<T>,T>
For Collections of Entities
-
-
Field Summary
-
Fields inherited from class com.legyver.utils.mapqua.mapbacked.MapBackedProperty
property, sourceMap, valueIfMissing
-
-
Constructor Summary
Constructors Constructor Description MapBackedEntityCollection(java.util.Map sourceMap, java.lang.String property, EntityInstantiator entityInstantiator)Construct a MapBackedEntityCollection with a certain property name.MapBackedEntityCollection(java.util.Map sourceMap, java.lang.String property, java.util.Collection valueIfMissing, EntityInstantiator entityInstantiator)Construct a MapBackedEntityCollection with a certain property name and default value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjecttoMap(T o)Return the internal map where the MapBackedEntityCollection is stored-
Methods inherited from class com.legyver.utils.mapqua.mapbacked.MapBackedCollection
add, deTransform, get, map, queryOption, remove, sync, transform
-
Methods inherited from class com.legyver.utils.mapqua.mapbacked.MapBackedProperty
set
-
-
-
-
Constructor Detail
-
MapBackedEntityCollection
public MapBackedEntityCollection(java.util.Map sourceMap, java.lang.String property, java.util.Collection valueIfMissing, EntityInstantiator entityInstantiator)Construct a MapBackedEntityCollection with a certain property name and default value- Parameters:
sourceMap- Map to store the Collection value inproperty- Key name of the propertyvalueIfMissing- value to set if missingentityInstantiator- function to use to instantiate a new entry in the collection
-
MapBackedEntityCollection
public MapBackedEntityCollection(java.util.Map sourceMap, java.lang.String property, EntityInstantiator entityInstantiator)Construct a MapBackedEntityCollection with a certain property name. The default value will be a new ArrayList- Parameters:
sourceMap- Map to store the Collection value inproperty- Key name of the propertyentityInstantiator- function to use to instantiate a new entry in the collection
-
-
Method Detail
-
toMap
protected java.lang.Object toMap(T o) throws com.legyver.core.exception.CoreException
Return the internal map where the MapBackedEntityCollection is stored- Specified by:
toMapin classMapBackedCollection<java.util.Collection<T extends RawMapAware>,T extends RawMapAware>- Parameters:
o- the object whose map will be returned- Returns:
- the raw map for the passed in Object
- Throws:
com.legyver.core.exception.CoreException- if there is a problem marshalling to/from JSON
-
-