public interface ResultCollection extends ResultElement, Iterable<ResultElement>
Use the method collect(String)
to collect elements inside this object as CollectedResultCollection
identified by a certain name.
Use the method asList(Class)
to cast this collection into a list of instances of a certain class type.
Use the method asSet(Class)
to cast this collection into a set of instances of a certain class type.
To cast this collection into a set or list of built-in data and object types, use methods such as
asStringList()
or asStringSet()
.
Modifier and Type | Method and Description |
---|---|
List<BigDecimal> |
asBigDecimalList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as BigDecimal . |
Set<BigDecimal> |
asBigDecimalSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as BigDecimal . |
List<BigInteger> |
asBigIntegerList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as BigInteger . |
Set<BigInteger> |
asBigIntegerSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as BigInteger . |
List<Boolean> |
asBooleanList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as Boolean . |
Set<Boolean> |
asBooleanSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as Boolean . |
List<Byte> |
asByteList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as Byte . |
Set<Byte> |
asByteSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as Byte . |
List<Character> |
asCharacterList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as Character . |
Set<Character> |
asCharacterSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as Character . |
List<Double> |
asDoubleList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as Double . |
Set<Double> |
asDoubleSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as Double . |
List<Float> |
asFloatList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as Float . |
Set<Float> |
asFloatSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as Float . |
List<Integer> |
asIntegerList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as Integer . |
Set<Integer> |
asIntegerSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as Integer . |
<T> List<T> |
asList(Class<T> objectType)
|
List<Long> |
asLongList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as Long . |
Set<Long> |
asLongSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as Long . |
<T> Set<T> |
asSet(Class<T> objectType)
|
List<Short> |
asShortList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as Short . |
Set<Short> |
asShortSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as Short . |
List<String> |
asStringList()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a List of all their values represented as String . |
Set<String> |
asStringSet()
Assuming all elements within this
ResultCollection are instances of ResultPrimitive , this method
returns a Set of all their values represented as String . |
CollectedResultCollection |
collect(String filterName)
Collects elements inside this
ResultCollection identified by filterName and returns a
CollectedResultCollection that contains only the collected elements. |
asBigDecimal, asBigInteger, asBoolean, asByte, asCharacter, asDouble, asFloat, asInteger, asLong, asShort, asString, getAsCollection, getAsObject, getAsPrimitive, isResultCollection, isResultObject, isResultPrimitive
forEach, iterator, spliterator
@Nonnull CollectedResultCollection collect(@Nonnull String filterName)
ResultCollection
identified by filterName
and returns a
CollectedResultCollection
that contains only the collected elements.filterName
- The name used to identify the items to collect.CollectedResultCollection
that contains only the collected elements.@Nonnull <T> List<T> asList(@Nonnull Class<T> objectType) throws UnsupportedOperationException
T
- The type the elements in this collection object shall be casted to.objectType
- The Class
type of the type T
.List
of all elements within this ResultCollection
casted into class type T
.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to T
.@Nonnull <T> Set<T> asSet(@Nonnull Class<T> objectType) throws UnsupportedOperationException
T
- The type the elements in this collection object shall be casted to.objectType
- The Class
type of the type T
.Set
of all elements within this ResultCollection
casted into class type T
.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to T
.@Nonnull List<Boolean> asBooleanList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as Boolean
.List
of Boolean
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to Boolean
.@Nonnull Set<Boolean> asBooleanSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as Boolean
.Set
of Boolean
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to Boolean
.@Nonnull List<Byte> asByteList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as Byte
.List
of Byte
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to Byte
.@Nonnull Set<Byte> asByteSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as Byte
.Set
of Byte
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to Byte
.@Nonnull List<Character> asCharacterList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as Character
.List
of Character
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to Character
.@Nonnull Set<Character> asCharacterSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as Character
.Set
of Character
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to Character
.@Nonnull List<String> asStringList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as String
.List
of String
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to String
.@Nonnull Set<String> asStringSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as String
.Set
of String
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to String
.@Nonnull List<Integer> asIntegerList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as Integer
.List
of Integer
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to Integer
.@Nonnull Set<Integer> asIntegerSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as Integer
.Set
of Integer
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to Integer
.@Nonnull List<Short> asShortList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as Short
.List
of Short
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to Short
.@Nonnull Set<Short> asShortSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as Short
.Set
of Short
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to Short
.@Nonnull List<Long> asLongList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as Long
.List
of Long
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to Long
.@Nonnull Set<Long> asLongSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as Long
.Set
of Long
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to Long
.@Nonnull List<Float> asFloatList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as Float
.List
of Float
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to Float
.@Nonnull Set<Float> asFloatSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as Float
.Set
of Float
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to Float
.@Nonnull List<Double> asDoubleList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as Double
.List
of Double
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to Double
.@Nonnull Set<Double> asDoubleSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as Double
.Set
of Double
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to Double
.@Nonnull List<BigInteger> asBigIntegerList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as BigInteger
.List
of BigInteger
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to BigInteger
.@Nonnull Set<BigInteger> asBigIntegerSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as BigInteger
.Set
of BigInteger
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to BigInteger
.@Nonnull List<BigDecimal> asBigDecimalList() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a List
of all their values represented as BigDecimal
.List
of BigDecimal
objects.UnsupportedOperationException
- If this class does not support the creation of a List
or at least one element could not be
cast to BigDecimal
.@Nonnull Set<BigDecimal> asBigDecimalSet() throws UnsupportedOperationException
ResultCollection
are instances of ResultPrimitive
, this method
returns a Set
of all their values represented as BigDecimal
.Set
of BigDecimal
objects.UnsupportedOperationException
- If this class does not support the creation of a Set
or at least one element could not be
cast to BigDecimal
.Copyright © 2020 SAP SE. All rights reserved.