public final class BeanMap<K,E> extends AbstractBeanCollection<E> implements Map<K,E>
BeanCollection.ModifyListenModedisableLazyLoad, ebeanServerName, filterMany, loader, modifyAddListening, modifyHolder, modifyListening, modifyListenMode, modifyRemoveListening, ownerBean, propertyName, readOnly, registeredWithLoadContext| Constructor and Description |
|---|
BeanMap()
Create using a underlying LinkedHashMap.
|
BeanMap(BeanCollectionLoader ebeanServer,
EntityBean ownerBean,
String propertyName) |
BeanMap(Map<K,E> map)
Create with a given Map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBean(E bean)
Add a bean to the list/set with modifyListen notification.
|
boolean |
checkEmptyLazyLoad()
Check after the lazy load that the underlying collection is not null
(handle case where join to many not outer).
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,E>> |
entrySet() |
boolean |
equals(Object obj)
Equal if obj is a Map and equal in a Map sense.
|
E |
get(Object key) |
Collection<E> |
getActualDetails()
Returns the collection of beans (map values).
|
Collection<?> |
getActualEntries()
Returns the map entrySet.
|
Map<K,E> |
getActualMap()
Return the actual underlying map.
|
int |
hashCode() |
void |
internalAdd(Object bean)
Add the bean to the collection.
|
void |
internalAddWithCheck(Object bean)
Add the bean with a check to see if it is already contained.
|
void |
internalPut(Object key,
Object bean) |
void |
internalPutNull() |
void |
internalPutWithCheck(Object key,
Object bean) |
boolean |
isEmpty()
Return true if the List Set or Map is empty.
|
boolean |
isPopulated()
Return true if the underlying map has been populated.
|
boolean |
isReference()
Return true if this is a reference (lazy loading) bean collection.
|
boolean |
isSkipSave()
Return true if the collection is uninitialised or is empty without any held modifications.
|
Set<K> |
keySet() |
void |
loadFrom(BeanCollection<?> other)
Load bean from another collection.
|
E |
put(K key,
E value) |
void |
putAll(Map<? extends K,? extends E> puts) |
E |
remove(Object key) |
void |
removeBean(E bean)
Remove a bean to the list/set with modifyListen notification.
|
void |
reset(EntityBean ownerBean,
String propertyName)
Reset the collection back to an empty state ready for reloading.
|
void |
setActualMap(Map<?,?> map)
Set the actual underlying map.
|
int |
size()
Return the number of elements in the List Set or Map.
|
String |
toString() |
Collection<E> |
values() |
checkReadOnly, getFilterMany, getModifyAdditions, getModifyHolder, getModifyListenMode, getModifyRemovals, getOwnerBean, getPropertyName, holdsModifications, isReadOnly, isRegisteredWithLoadContext, lazyLoadCollection, modifyAddition, modifyRemoval, modifyReset, setDisableLazyLoad, setFilterMany, setLoader, setModifyListening, setReadOnlyclone, finalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic BeanMap()
public BeanMap(BeanCollectionLoader ebeanServer, EntityBean ownerBean, String propertyName)
public void reset(EntityBean ownerBean, String propertyName)
BeanCollectionThis is done as part of bean refresh.
reset in interface BeanCollection<E>public boolean isSkipSave()
BeanCollectionReturning true means can safely skip cascade save for this bean collection.
isSkipSave in interface BeanCollection<E>public void loadFrom(BeanCollection<?> other)
BeanCollectionloadFrom in interface BeanCollection<E>public void internalPutNull()
public void internalPut(Object key, Object bean)
public void internalPutWithCheck(Object key, Object bean)
public void internalAddWithCheck(Object bean)
BeanCollectioninternalAddWithCheck in interface BeanCollection<E>public void internalAdd(Object bean)
BeanCollectionThis is disallowed for BeanMap.
internalAdd in interface BeanCollection<E>public boolean isPopulated()
isPopulated in interface BeanCollection<E>public boolean isReference()
isReference in interface BeanCollection<E>public boolean checkEmptyLazyLoad()
BeanCollectionThat is, if the collection was not loaded due to filterMany predicates etc then make sure the collection is set to empty.
checkEmptyLazyLoad in interface BeanCollection<E>public void setActualMap(Map<?,?> map)
public Map<K,E> getActualMap()
public Collection<E> getActualDetails()
getActualDetails in interface BeanCollection<E>public Collection<?> getActualEntries()
This is because the key values may need to be set against the details (so they don't need to be set twice).
getActualEntries in interface BeanCollection<E>public int hashCode()
public boolean containsKey(Object key)
containsKey in interface Map<K,E>public boolean containsValue(Object value)
containsValue in interface Map<K,E>public boolean isEmpty()
BeanCollectionpublic void addBean(E bean)
BeanCollectionaddBean in interface BeanCollection<E>public void removeBean(E bean)
BeanCollectionremoveBean in interface BeanCollection<E>public int size()
BeanCollectionCopyright © 2016. All rights reserved.