public final class BeanList<E> extends Object implements List<E>, BeanCollectionAdd
BeanCollection.ModifyListenMode| Constructor and Description |
|---|
BeanList()
Uses an ArrayList as the underlying List implementation.
|
BeanList(BeanCollectionLoader loader,
EntityBean ownerBean,
String propertyName)
Used to create deferred fetch proxy.
|
BeanList(List<E> list)
Specify the underlying List implementation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o) |
void |
add(int index,
E element) |
boolean |
addAll(Collection<? extends E> c) |
boolean |
addAll(int index,
Collection<? extends E> c) |
void |
addBean(E bean)
Add a bean to the list/set with modifyListen notification.
|
void |
addEntityBean(EntityBean bean)
Add a loaded bean to the collection.
|
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 |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object obj)
Equal if obj is a List and equal in a list sense.
|
E |
get(int index) |
Collection<E> |
getActualDetails()
Returns the underlying collection of beans from the Set, Map or List.
|
Collection<?> |
getActualEntries()
Returns the underlying entries so for Maps this is a collection of
Map.Entry.
|
List<E> |
getActualList()
Return the actual underlying list.
|
ExpressionList<?> |
getFilterMany()
Return the filter (if any) that was used in building this collection.
|
Set<E> |
getModifyAdditions()
Return the list of objects added to the list set or map.
|
BeanCollection.ModifyListenMode |
getModifyListening()
Return the current modify listening mode.
|
BeanCollection.ModifyListenMode |
getModifyListenMode()
Return the modify listening mode this collection is using.
|
Set<E> |
getModifyRemovals()
Return the list of objects removed from the list set or map.
|
EntityBean |
getOwnerBean()
Return the bean that owns this collection.
|
String |
getPropertyName()
Return the bean property name this collection represents.
|
BeanCollection<E> |
getShallowCopy()
Return a shallow copy of this collection that is modifiable.
|
int |
hashCode() |
boolean |
holdsModifications()
Return true if there are underlying additions or removals.
|
int |
indexOf(Object o) |
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.
|
boolean |
isEmpty()
Return true if the List Set or Map is empty.
|
boolean |
isPopulated()
Return true if the underlying list is populated.
|
boolean |
isReadOnly()
Return true if the collection should be treated as readOnly and no elements
can be added or removed etc.
|
boolean |
isReference()
Return true if this is a reference (lazy loading) bean collection.
|
boolean |
isRegisteredWithLoadContext()
Return true if the collection has been registered with the batch loading context.
|
boolean |
isSkipSave()
Return true if the collection is uninitialised or is empty without any held modifications.
|
Iterator<E> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
void |
loadFrom(BeanCollection<?> other)
Load bean from another collection.
|
void |
modifyAddition(E bean)
Add an object to the additions list.
|
void |
modifyRemoval(Object bean)
Add an object to the deletions list.
|
void |
modifyReset()
Reset the set of additions and deletions.
|
E |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> beans) |
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.
|
boolean |
retainAll(Collection<?> retainBeans) |
E |
set(int index,
E element) |
void |
setActualList(List<?> list)
Set the actual underlying list.
|
void |
setDisableLazyLoad(boolean disableLazyLoad)
Set the disableLazyLoad state.
|
void |
setFilterMany(ExpressionList<?> filterMany)
Set the filter that was used in building this collection.
|
void |
setLoader(BeanCollectionLoader loader)
Set the loader that will be used to lazy/query load this collection.
|
void |
setModifyListening(BeanCollection.ModifyListenMode mode)
set modifyListening to be on or off.
|
void |
setReadOnly(boolean readOnly)
Set to true if you want the BeanCollection to be treated as read only.
|
int |
size()
Return the number of elements in the List Set or Map.
|
List<E> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
boolean |
wasTouched()
Has been modified by an addition or removal.
|
replaceAll, sort, spliteratorparallelStream, removeIf, streampublic BeanList()
public BeanList(BeanCollectionLoader loader, 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 addEntityBean(EntityBean bean)
BeanCollectionAddaddEntityBean in interface BeanCollectionAddpublic void loadFrom(BeanCollection<?> other)
BeanCollectionloadFrom in interface BeanCollection<E>public void internalAdd(Object bean)
BeanCollectionThis is disallowed for BeanMap.
internalAdd in interface BeanCollection<E>public void internalAddWithCheck(Object bean)
BeanCollectioninternalAddWithCheck 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 setActualList(List<?> list)
This is primarily for the deferred fetching function.
public List<E> getActualList()
public Collection<E> getActualDetails()
BeanCollectiongetActualDetails in interface BeanCollection<E>public Collection<?> getActualEntries()
BeanCollectionFor maps this returns the entrySet as we need the keys of the map.
getActualEntries in interface BeanCollection<E>public boolean isPopulated()
isPopulated in interface BeanCollection<E>public boolean isReference()
isReference in interface BeanCollection<E>public boolean equals(Object obj)
Specifically obj does not need to be a BeanList but any list. This does not use the FindMany, fetchedMaxRows or finishedFetch properties in the equals test.
public int hashCode()
public void addBean(E bean)
BeanCollectionaddBean in interface BeanCollection<E>public boolean addAll(Collection<? extends E> c)
public boolean addAll(int index, Collection<? extends E> c)
public void clear()
public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface List<E>public boolean isEmpty()
BeanCollectionisEmpty in interface BeanCollection<E>isEmpty in interface Collection<E>isEmpty in interface List<E>public int lastIndexOf(Object o)
lastIndexOf in interface List<E>public ListIterator<E> listIterator()
listIterator in interface List<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>public void removeBean(E bean)
BeanCollectionremoveBean in interface BeanCollection<E>public boolean removeAll(Collection<?> beans)
public boolean retainAll(Collection<?> retainBeans)
public int size()
BeanCollectionsize in interface BeanCollection<E>size in interface Collection<E>size in interface List<E>public <T> T[] toArray(T[] a)
public BeanCollection<E> getShallowCopy()
BeanCollectiongetShallowCopy in interface BeanCollection<E>public EntityBean getOwnerBean()
BeanCollectiongetOwnerBean in interface BeanCollection<E>public String getPropertyName()
BeanCollectiongetPropertyName in interface BeanCollection<E>public ExpressionList<?> getFilterMany()
BeanCollectionThis is so that the filter can be applied on refresh.
getFilterMany in interface BeanCollection<E>public void setFilterMany(ExpressionList<?> filterMany)
BeanCollectionsetFilterMany in interface BeanCollection<E>public void setDisableLazyLoad(boolean disableLazyLoad)
BeanCollectionsetDisableLazyLoad in interface BeanCollection<E>public boolean isRegisteredWithLoadContext()
BeanCollectionisRegisteredWithLoadContext in interface BeanCollection<E>public void setLoader(BeanCollectionLoader loader)
BeanCollectionThis is effectively the batch loading context this collection is registered with.
setLoader in interface BeanCollection<E>public boolean isReadOnly()
BeanCollectionisReadOnly in interface BeanCollection<E>public void setReadOnly(boolean readOnly)
BeanCollectionsetReadOnly in interface BeanCollection<E>public BeanCollection.ModifyListenMode getModifyListening()
BeanCollectiongetModifyListening in interface BeanCollection<E>public void setModifyListening(BeanCollection.ModifyListenMode mode)
setModifyListening in interface BeanCollection<E>public BeanCollection.ModifyListenMode getModifyListenMode()
public void modifyAddition(E bean)
BeanCollectionThis will potentially end up as an insert into a intersection table for a ManyToMany.
modifyAddition in interface BeanCollection<E>public void modifyRemoval(Object bean)
BeanCollectionThis will potentially end up as an delete from an intersection table for a ManyToMany.
modifyRemoval in interface BeanCollection<E>public void modifyReset()
BeanCollectionmodifyReset in interface BeanCollection<E>public Set<E> getModifyAdditions()
BeanCollectiongetModifyAdditions in interface BeanCollection<E>public Set<E> getModifyRemovals()
BeanCollectiongetModifyRemovals in interface BeanCollection<E>public boolean holdsModifications()
holdsModifications in interface BeanCollection<E>public boolean wasTouched()
BeanCollectionwasTouched in interface BeanCollection<E>Copyright © 2019. All rights reserved.