Package io.jmix.core
Class EntitySet
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.collect.ForwardingCollection<E>
com.google.common.collect.ForwardingSet<Object>
io.jmix.core.EntitySet
- All Implemented Interfaces:
- Serializable,- Iterable<Object>,- Collection<Object>,- Set<Object>
public class EntitySet
extends com.google.common.collect.ForwardingSet<Object>
implements Serializable
Implementation of 
Set<Entity> with convenient methods for getting entities by a prototype instance
 or by a class and id.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected Setdelegate()<T> TReturns the entity if it exists in the set.<T> Tget(T prototype) Returns the entity if it exists in the set.<T> Collection<T>Returns a collection of entities of the specified class.static EntitySetof(Collection<?> entities) Creates theEntitySetby copying the given collection to the internal set.static EntitySetCreates theEntitySetwrapping an existing set.<T> Optional<T>Returns the entity wrapped inOptionalif it exists in the set.<T> Optional<T>optional(T prototype) Returns the entity wrapped inOptionalif it exists in the set.Methods inherited from class com.google.common.collect.ForwardingSetequals, hashCode, standardEquals, standardHashCode, standardRemoveAllMethods inherited from class com.google.common.collect.ForwardingCollectionadd, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArrayMethods inherited from class com.google.common.collect.ForwardingObjecttoStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArray
- 
Constructor Details- 
EntitySetpublic EntitySet()
- 
EntitySet
- 
EntitySet
 
- 
- 
Method Details- 
ofCreates theEntitySetwrapping an existing set.
- 
ofCreates theEntitySetby copying the given collection to the internal set.
- 
optionalReturns the entity wrapped inOptionalif it exists in the set.- Parameters:
- entityClass- class of entity
- entityId- entity id
 
- 
optionalReturns the entity wrapped inOptionalif it exists in the set.- Parameters:
- prototype- a prototype instance whose class and id are used to look up an entity in the set.
 
- 
getReturns the entity if it exists in the set.- Parameters:
- entityClass- class of entity
- entityId- entity id
- Throws:
- IllegalArgumentException- if the entity not found
 
- 
getpublic <T> T get(T prototype) Returns the entity if it exists in the set.- Parameters:
- prototype- a prototype instance whose class and id are used to look up an entity in the set.
- Throws:
- IllegalArgumentException- if the entity not found
 
- 
getAllReturns a collection of entities of the specified class.- Parameters:
- entityClass- class of entities
 
- 
delegate- Specified by:
- delegatein class- com.google.common.collect.ForwardingSet<Object>
 
 
-