Package cz.cvut.kbss.jopa.proxy.lazy
Class LazyLoadingMapProxy<T,K,V>  
java.lang.Object
cz.cvut.kbss.jopa.proxy.lazy.LazyLoadingMapProxy<T,K,V>  
- Type Parameters:
- T- Type of the object whose attribute value is this map proxy
- K- Map key type
- V- Map value type
- All Implemented Interfaces:
- LazyLoadingProxy<Map<K,,- V>> - Map<K,- V> 
public class LazyLoadingMapProxy<T,K,V>  
extends Object
implements LazyLoadingProxy<Map<K,V>>, Map<K,V>  
Map proxy that triggers lazy loading when its contents is accessed.- 
Nested Class Summary
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final FieldSpecification<? super T,Map<K, V>> protected final Tprotected final UnitOfWork
- 
Constructor SummaryConstructorsConstructorDescriptionLazyLoadingMapProxy(T owner, FieldSpecification<? super T, Map<K, V>> fieldSpec, UnitOfWork persistenceContext) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()If this proxy has already been loaded, this method returns the loaded value.booleanisEmpty()booleanisLoaded()Checks whether this proxy has already been loaded.keySet()voidintsize()toString()Triggers value loading.unwrap()Gets a value that should be used to replace this proxy outside a persistence context.values()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
- 
Field Details- 
owner
- 
fieldSpec
- 
persistenceContext
 
- 
- 
Constructor Details- 
LazyLoadingMapProxypublic LazyLoadingMapProxy(T owner, FieldSpecification<? super T, Map<K, V>> fieldSpec, UnitOfWork persistenceContext) 
 
- 
- 
Method Details- 
triggerLazyLoadingDescription copied from interface:LazyLoadingProxyTriggers value loading.- Specified by:
- triggerLazyLoadingin interface- LazyLoadingProxy<T>
- Returns:
- Loaded value
 
- 
isLoadedpublic boolean isLoaded()Description copied from interface:LazyLoadingProxyChecks whether this proxy has already been loaded.- Specified by:
- isLoadedin interface- LazyLoadingProxy<T>
- Returns:
- trueif this proxy has been loaded,- falseotherwise
 
- 
getLoadedValueDescription copied from interface:LazyLoadingProxyIf this proxy has already been loaded, this method returns the loaded value.- Specified by:
- getLoadedValuein interface- LazyLoadingProxy<T>
- Returns:
- The loaded value, nullif this proxy has not been loaded, yet
- See Also:
 
- 
unwrapDescription copied from interface:LazyLoadingProxyGets a value that should be used to replace this proxy outside a persistence context.- Specified by:
- unwrapin interface- LazyLoadingProxy<T>
- Returns:
- Default value to replace this proxy with
 
- 
sizepublic int size()
- 
isEmptypublic boolean isEmpty()
- 
containsKey- Specified by:
- containsKeyin interface- Map<T,- K> 
 
- 
containsValue- Specified by:
- containsValuein interface- Map<T,- K> 
 
- 
get
- 
put
- 
remove
- 
putAll
- 
clearpublic void clear()
- 
keySet
- 
values
- 
entrySet
- 
toString
 
-