Interface Comet3Collection<T extends Comet3Entity>
- Type Parameters:
T- the type parameter
- All Superinterfaces:
Collection<T>,Iterable<T>,List<T>
- All Known Implementing Classes:
Actions,Colors,Comet3CollectionImpl,ConditionMenues,Conditions,DataFiles,Domains,FindStatement.Sourcefiles,FindStatements,FrameRules,Grid.Placeholders,Grids,GridTypes,Manifest,Messages,PageItems,PageItemStates,PageItemTypes,PageTemplate.Templates,PageTemplates,PanelStatements,PlaceholderGroup.Placeholders,PlaceholderGroups,Placeholders,PlaceholderVariants,PreviewStatements,RelatedTos,XEntities,XIndexes
The interface Comet 3 collection. For internal use only.
-
Method Summary
Modifier and TypeMethodDescriptionfindById(int id) Lookup the Entity refered by id in this collection.Get the time (unix timestamp) the collection was modified lastGet the name of the XML file associated with this particular collection.Get the name of the XML root element.merge(Comet3Collection<T> other) Merge collection other into the actual collection.merge(Comet3Collection<T> other, boolean deleteObj) Merge collection other into the actual collection.voidMerge an item into the actual list.voidsetLastModificationTimestamp(Long timestamp) Set the time the collection was modified lastMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Method Details
-
getLastModificationTimestamp
Long getLastModificationTimestamp()Get the time (unix timestamp) the collection was modified last- Returns:
- unix timestamp of last modification date
-
setLastModificationTimestamp
Set the time the collection was modified last- Parameters:
timestamp- the timestamp
-
merge
Merge collection other into the actual collection. Entries will be compared by ID, i.e.: equal IDs will be considered as equal objects. Newer objects take precedence over older, if both have the same modification date objects in collection other take precedence over objects in the actual collection.- Parameters:
other- the other- Returns:
- a newly created collection containing the most recent entities of both lists
-
merge
Merge collection other into the actual collection. Entries will be compared by ID, i.e.: equal IDs will be considered as equal objects. Newer objects take precedence over older, if both have the same modification date objects in collection other take precedence over objects in the actual collection. If deleteObj is set to true, objects not contained in collection other will be deleted from the actual collection.- Parameters:
other- the otherdeleteObj- the delete obj- Returns:
- a newly created collection containing the most recent entities of both lists
-
merge
Merge an item into the actual list. If this item does not yet exist (i.e.: there is no such object with the same Id), the item will be added, otherwise items will be merged according to the merge rules for this particular entity type.- Parameters:
item- the item
-
findById
Lookup the Entity refered by id in this collection.- Parameters:
id- the id- Returns:
- Entity object or null, if no such object exists
-
getXmlRootElementName
String getXmlRootElementName()Get the name of the XML root element. Typically this is getClass().getSimpleName().toLowerCase() and is implemented in the CometCollectionImpl adapter class.- Returns:
- name of the XML root element
-
getXmlFileName
String getXmlFileName()Get the name of the XML file associated with this particular collection. Typically this is getClass().getSimpleName().toLowerCase() + ".xml" and is implemented in the CometCollectionImpl adapter class- Returns:
- name of a XML file holding this particular list
-