Package org.apache.openjpa.kernel
Class DelegatingResultList<T>
java.lang.Object
org.apache.openjpa.kernel.DelegatingResultList<T>
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>,List<T>,ResultList<T>,Closeable
Delegating result list that can also perform exception translation
for use in facades.
- Since:
- 0.4.0
- Author:
- Marc Prud'hommeaux
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassDelegating iterator that also performs exception translation. -
Constructor Summary
ConstructorsConstructorDescriptionDelegatingResultList(ResultList<T> list) Constructor; supply delegate.DelegatingResultList(ResultList<T> list, RuntimeExceptionTranslator trans) Constructor; supply delegate and exception translator. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends T> c) booleanaddAll(Collection<? extends T> c) voidclear()voidclose()Close the list.booleanbooleancontainsAll(Collection<?> c) booleanget(int index) Return the direct delegate.Return the native delegate.Get the opaque user object attached to this receiver.inthashCode()intbooleanisClosed()Returns true if the list has been closed.booleanisEmpty()booleanReturns true if the provider backing this list is open.iterator()intlistIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) voidsetUserObject(Object opaque) Set the opaque user object to this receiver.intsize()subList(int fromIndex, int toIndex) Object[]toArray()Object[]toString()protected RuntimeExceptionTranslate the OpenJPA exception.Writes delegate, which may in turn write a normal list.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Constructor Details
-
DelegatingResultList
Constructor; supply delegate. -
DelegatingResultList
Constructor; supply delegate and exception translator.
-
-
Method Details
-
getDelegate
Return the direct delegate. -
getInnermostDelegate
Return the native delegate. -
writeReplace
Writes delegate, which may in turn write a normal list.- Throws:
ObjectStreamException
-
hashCode
public int hashCode() -
equals
-
translate
Translate the OpenJPA exception. -
isProviderOpen
public boolean isProviderOpen()Description copied from interface:ResultListReturns true if the provider backing this list is open.- Specified by:
isProviderOpenin interfaceResultList<T>
-
getUserObject
Description copied from interface:ResultListGet the opaque user object attached to this receiver.- Specified by:
getUserObjectin interfaceResultList<T>
-
setUserObject
Description copied from interface:ResultListSet the opaque user object to this receiver.- Specified by:
setUserObjectin interfaceResultList<T>
-
close
public void close()Description copied from interface:ResultListClose the list.- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceResultList<T>
-
isClosed
public boolean isClosed()Description copied from interface:ResultListReturns true if the list has been closed.- Specified by:
isClosedin interfaceResultList<T>
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
-
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceList<T>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T>
-
listIterator
- Specified by:
listIteratorin interfaceList<T>
-
listIterator
- Specified by:
listIteratorin interfaceList<T>
-
subList
-
toString
-