Module jonix.common
Package com.tectonica.jonix.common
Class ListOfOnixCodelist<E extends OnixElement<V>,V extends OnixCodelist>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
com.tectonica.jonix.common.ListOfOnixElement<E,V>
com.tectonica.jonix.common.ListOfOnixCodelist<E,V>
- Type Parameters:
E
- the type of theOnixElement
containing theOnixCodelist
V
- the type of theOnixCodelist
enum
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<E>
,Collection<E>
,List<E>
,RandomAccess
public class ListOfOnixCodelist<E extends OnixElement<V>,V extends OnixCodelist>
extends ListOfOnixElement<E,V>
Stores a list of
OnixCodelist
s, each of which is a Java Enum
containing a code
and a
description
. It is used with OnixElement
s that are repeatable, i.e. can indicate more than one
codelist (for example <ProductFormDetail>).- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncodes()
static <X extends OnixElement<Y>,
Y extends OnixCodelist>
ListOfOnixCodelist<X,Y> pairs()
Given theOnixCodelist
s stored in this container, this method returns aString
-based(code,description)
list of tuples.<C extends Collection<OnixCodelist.Pair>>
CpairsInto
(C collection) stores into a givenCollection
the(String,String)
code+description pairs stored within the elements of this containerpairsMap()
Given theOnixCodelist
s stored in this container, this method returns aString
-based map of(code -> description)
entries.Methods inherited from class com.tectonica.jonix.common.ListOfOnixElement
empty, first, firstValue, firstValueOrNull, values, valuesInto
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
ListOfOnixCodelist
public ListOfOnixCodelist()
-
-
Method Details
-
pairs
Given theOnixCodelist
s stored in this container, this method returns aString
-based(code,description)
list of tuples. It is a "type-free" representation of the codelists, suitable for cross-comparisons.- Returns:
- a non-null, possibly empty, list of code+description pairs
-
pairsMap
Given theOnixCodelist
s stored in this container, this method returns aString
-based map of(code -> description)
entries. It is a "type-free" representation of the codelists, suitable for cross-comparisons.- Returns:
- a non-null, possibly empty, map of code->description
-
codes
- Returns:
- a non-null, possibly empty, set of all the
OnixCodelist
'scode
s stored in this container
-
descriptions
- Returns:
- a non-null, possibly empty, set of all the
OnixCodelist
'sdescriptions
s stored in this container
-
pairsInto
stores into a givenCollection
the(String,String)
code+description pairs stored within the elements of this container- Returns:
- the same passed collection, after being populated
-
firstPair
- Returns:
- an
Optional
of the firstOnixCodelist
listed, if any, wrapped as a code+descriptionOnixCodelist.Pair
-
firstPairOrNull
- Returns:
- the first
OnixCodelist
listed, if any, wrapped as a code+descriptionOnixCodelist.Pair
, ornull
if none is listed
-
emptyList
public static <X extends OnixElement<Y>,Y extends OnixCodelist> ListOfOnixCodelist<X,Y> emptyList()
-