Package cz.cvut.kbss.jopa.proxy.lazy
Class LazyLoadingSetProxy<O,E>
java.lang.Object
cz.cvut.kbss.jopa.proxy.lazy.LazyLoadingSetProxy<O,E>
- All Implemented Interfaces:
LazyLoadingProxy<Set<E>>,Iterable<E>,Collection<E>,Set<E>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FieldSpecification<? super O,Set<E>> protected final Oprotected final UnitOfWork -
Constructor Summary
ConstructorsConstructorDescriptionLazyLoadingSetProxy(O owner, FieldSpecification<? super O, Set<E>> fieldSpec, UnitOfWork persistenceContext) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> c) voidclear()booleanbooleancontainsAll(Collection<?> c) If this proxy has already been loaded, this method returns the loaded value.booleanisEmpty()booleanisLoaded()Checks whether this proxy has already been loaded.iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<ET> ET[]toArray(ET[] a) toString()Triggers value loading.unwrap()Gets a value that should be used to replace this proxy outside a persistence context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Field Details
-
owner
-
fieldSpec
-
persistenceContext
-
-
Constructor Details
-
LazyLoadingSetProxy
public LazyLoadingSetProxy(O owner, FieldSpecification<? super O, Set<E>> fieldSpec, UnitOfWork persistenceContext)
-
-
Method Details
-
unwrap
Description copied from interface:LazyLoadingProxyGets a value that should be used to replace this proxy outside a persistence context.- Specified by:
unwrapin interfaceLazyLoadingProxy<O>- Returns:
- Default value to replace this proxy with
-
triggerLazyLoading
Description copied from interface:LazyLoadingProxyTriggers value loading.- Specified by:
triggerLazyLoadingin interfaceLazyLoadingProxy<O>- Returns:
- Loaded value
-
isLoaded
public boolean isLoaded()Description copied from interface:LazyLoadingProxyChecks whether this proxy has already been loaded.- Specified by:
isLoadedin interfaceLazyLoadingProxy<O>- Returns:
trueif this proxy has been loaded,falseotherwise
-
getLoadedValue
Description copied from interface:LazyLoadingProxyIf this proxy has already been loaded, this method returns the loaded value.- Specified by:
getLoadedValuein interfaceLazyLoadingProxy<O>- Returns:
- The loaded value,
nullif this proxy has not been loaded, yet - See Also:
-
size
public int size()- Specified by:
sizein interfaceCollection<O>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<O>
-
contains
- Specified by:
containsin interfaceCollection<O>
-
iterator
- Specified by:
iteratorin interfaceCollection<O>- Specified by:
iteratorin interfaceIterable<O>
-
toArray
- Specified by:
toArrayin interfaceCollection<O>
-
toArray
public <ET> ET[] toArray(ET[] a) - Specified by:
toArrayin interfaceCollection<O>
-
add
- Specified by:
addin interfaceCollection<O>
-
remove
- Specified by:
removein interfaceCollection<O>
-
containsAll
- Specified by:
containsAllin interfaceCollection<O>
-
addAll
- Specified by:
addAllin interfaceCollection<O>
-
removeAll
- Specified by:
removeAllin interfaceCollection<O>
-
retainAll
- Specified by:
retainAllin interfaceCollection<O>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<O>
-
toString
-