Package com.sap.cloud.sdk.result
Interface ResultCollection
- All Superinterfaces:
Iterable<ResultElement>
,ResultElement
- All Known Implementing Classes:
DefaultResultCollection
Interface representing one collection of result elements (e.g. a list of complex business objects) resulting from a
call to an external service (e.g. after invoking a BAPI or a remote-enabled function module).
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()
.
-
Method Summary
Modifier and TypeMethodDescriptionAssuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asBigDecimal
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asBigDecimal
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asBigInteger
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asBigInteger
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asBoolean
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asBoolean
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asByte
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asByte
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asCharacter
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asCharacter
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asDouble
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asDouble
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asFloat
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asFloat
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asInteger
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asInteger
.<T> List<T>
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asLong
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asLong
.<T> Set<T>
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asShort
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asShort
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asString
.Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asString
.Collects elements inside thisResultCollection
identified byfilterName
and returns aCollectedResultCollection
that contains only the collected elements.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface com.sap.cloud.sdk.result.ResultElement
asBigDecimal, asBigInteger, asBoolean, asByte, asCharacter, asDouble, asFloat, asInteger, asLong, asShort, asString, getAsCollection, getAsObject, getAsPrimitive, isResultCollection, isResultObject, isResultPrimitive
-
Method Details
-
collect
Collects elements inside thisResultCollection
identified byfilterName
and returns aCollectedResultCollection
that contains only the collected elements.- Parameters:
filterName
- The name used to identify the items to collect.- Returns:
- Instance of
CollectedResultCollection
that contains only the collected elements.
-
asList
- Type Parameters:
T
- The type the elements in this collection object shall be casted to.- Parameters:
objectType
- TheClass
type of the typeT
.- Returns:
- A
List
of all elements within thisResultCollection
casted into class typeT
. - Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toT
.
-
asSet
- Type Parameters:
T
- The type the elements in this collection object shall be casted to.- Parameters:
objectType
- TheClass
type of the typeT
.- Returns:
- A
Set
of all elements within thisResultCollection
casted into class typeT
. - Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toT
.
-
asBooleanList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asBoolean
.- Returns:
List
ofBoolean
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toBoolean
.
-
asBooleanSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asBoolean
.- Returns:
Set
ofBoolean
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toBoolean
.
-
asByteList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asByte
.- Returns:
List
ofByte
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toByte
.
-
asByteSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asByte
.- Returns:
Set
ofByte
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toByte
.
-
asCharacterList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asCharacter
.- Returns:
List
ofCharacter
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toCharacter
.
-
asCharacterSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asCharacter
.- Returns:
Set
ofCharacter
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toCharacter
.
-
asStringList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asString
.- Returns:
List
ofString
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toString
.
-
asStringSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asString
.- Returns:
Set
ofString
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toString
.
-
asIntegerList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asInteger
.- Returns:
List
ofInteger
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toInteger
.
-
asIntegerSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asInteger
.- Returns:
Set
ofInteger
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toInteger
.
-
asShortList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asShort
.- Returns:
List
ofShort
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toShort
.
-
asShortSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asShort
.- Returns:
Set
ofShort
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toShort
.
-
asLongList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asLong
.- Returns:
List
ofLong
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toLong
.
-
asLongSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asLong
.- Returns:
Set
ofLong
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toLong
.
-
asFloatList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asFloat
.- Returns:
List
ofFloat
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toFloat
.
-
asFloatSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asFloat
.- Returns:
Set
ofFloat
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toFloat
.
-
asDoubleList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asDouble
.- Returns:
List
ofDouble
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toDouble
.
-
asDoubleSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asDouble
.- Returns:
Set
ofDouble
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toDouble
.
-
asBigIntegerList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asBigInteger
.- Returns:
List
ofBigInteger
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toBigInteger
.
-
asBigIntegerSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asBigInteger
.- Returns:
Set
ofBigInteger
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toBigInteger
.
-
asBigDecimalList
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aList
of all their values represented asBigDecimal
.- Returns:
List
ofBigDecimal
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aList
or at least one element could not be cast toBigDecimal
.
-
asBigDecimalSet
Assuming all elements within thisResultCollection
are instances ofResultPrimitive
, this method returns aSet
of all their values represented asBigDecimal
.- Returns:
Set
ofBigDecimal
objects.- Throws:
UnsupportedOperationException
- If this class does not support the creation of aSet
or at least one element could not be cast toBigDecimal
.
-