Class DtList<D extends DtObject>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<D>
-
- io.vertigo.datamodel.structure.model.DtList<D>
-
- Type Parameters:
D
- Type du DtObject
- All Implemented Interfaces:
Serializable
,Iterable<D>
,Collection<D>
,List<D>
public final class DtList<D extends DtObject> extends AbstractList<D> implements Serializable
Classe de stockage des listes. Une dtList est une liste constituée avec un seul type d'objet. Les objets null ne sont pas autorisés.- Author:
- fconstantin
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
TOTAL_COUNT_META
total count-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, D dto)
boolean
add(D dto)
boolean
containsMetaData(String metaDataName)
boolean
equals(Object o)
D
get(int row)
DtDefinition
getDefinition()
<O extends Serializable>
Optional<O>getMetaData(String metaDataName, Class<O> metaDataClass)
Set<String>
getMetaDataNames()
DtListURI
getURI()
int
hashCode()
static <D extends DtObject>
DtList<D>of(D dto, D... dtos)
Static method factory for convenient creation of DtList using 'of' pattern.static <D extends DtObject>
DtList<D>of(D dto, List<D> dtos)
Static method factory for convenient creation of DtList using 'of' pattern.D
remove(int row)
D
set(int row, D object)
void
setMetaData(String metaDataName, Serializable value)
Set a metaData on this list.int
size()
List<D>
subList(int start, int end)
String
toString()
-
Methods inherited from class java.util.AbstractList
addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Field Detail
-
TOTAL_COUNT_META
public static final String TOTAL_COUNT_META
total count- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DtList
public DtList(DtDefinition dtDefinition)
Constructor.- Parameters:
dtDefinition
- Définition de DT
-
DtList
public DtList(DtList<D> dtList, DtListURI uri)
Constructor.- Parameters:
dtList
- DtList to cloneuri
- DtList uri
-
-
Method Detail
-
of
@SafeVarargs public static <D extends DtObject> DtList<D> of(D dto, D... dtos)
Static method factory for convenient creation of DtList using 'of' pattern.- Type Parameters:
D
- Type of this list- Parameters:
dto
- the mandatory dto to add which defines the type.dtos
- Dtos to add.- Returns:
- the created DtList.
-
of
public static <D extends DtObject> DtList<D> of(D dto, List<D> dtos)
Static method factory for convenient creation of DtList using 'of' pattern.- Type Parameters:
D
- Type of this list- Parameters:
dto
- the mandatory dto to add which defines the type.dtos
- Dtos to add.- Returns:
- the created DtList.
-
get
public D get(int row)
-
size
public int size()
-
toString
public String toString()
- Overrides:
toString
in classAbstractCollection<D extends DtObject>
-
add
public boolean add(D dto)
-
add
public void add(int index, D dto)
-
remove
public D remove(int row)
-
getDefinition
public DtDefinition getDefinition()
- Returns:
- Définition de la liste.
-
getURI
public DtListURI getURI()
- Returns:
- URI de la ressource
-
containsMetaData
public boolean containsMetaData(String metaDataName)
- Parameters:
metaDataName
- MetaData name- Returns:
- if this metadata is known and not null
-
getMetaData
public <O extends Serializable> Optional<O> getMetaData(String metaDataName, Class<O> metaDataClass)
- Type Parameters:
O
- MetaData value type- Parameters:
metaDataName
- MetaData namemetaDataClass
- MetaData value class- Returns:
- MetaData value
-
setMetaData
public void setMetaData(String metaDataName, Serializable value)
Set a metaData on this list. If value is null, the metadata is remove. WARN Developers must ensure this metaData keep coherent with current list datas, all the time. WARN- Parameters:
metaDataName
- MetaData namevalue
- MetaData value
-
equals
public boolean equals(Object o)
-
-