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 thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asBigDecimal.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asBigDecimal.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asBigInteger.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asBigInteger.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asBoolean.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asBoolean.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asByte.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asByte.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asCharacter.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asCharacter.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asDouble.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asDouble.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asFloat.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asFloat.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asInteger.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asInteger.<T> List<T>Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asLong.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asLong.<T> Set<T>Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asShort.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asShort.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asString.Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asString.Collects elements inside thisResultCollectionidentified byfilterNameand returns aCollectedResultCollectionthat contains only the collected elements.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods 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 thisResultCollectionidentified byfilterNameand returns aCollectedResultCollectionthat contains only the collected elements.- Parameters:
filterName- The name used to identify the items to collect.- Returns:
- Instance of
CollectedResultCollectionthat contains only the collected elements.
-
asList
- Type Parameters:
T- The type the elements in this collection object shall be casted to.- Parameters:
objectType- TheClasstype of the typeT.- Returns:
- A
Listof all elements within thisResultCollectioncasted into class typeT. - Throws:
UnsupportedOperationException- If this class does not support the creation of aListor 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- TheClasstype of the typeT.- Returns:
- A
Setof all elements within thisResultCollectioncasted into class typeT. - Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toT.
-
asBooleanList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asBoolean.- Returns:
ListofBooleanobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toBoolean.
-
asBooleanSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asBoolean.- Returns:
SetofBooleanobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toBoolean.
-
asByteList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asByte.- Returns:
ListofByteobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toByte.
-
asByteSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asByte.- Returns:
SetofByteobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toByte.
-
asCharacterList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asCharacter.- Returns:
ListofCharacterobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toCharacter.
-
asCharacterSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asCharacter.- Returns:
SetofCharacterobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toCharacter.
-
asStringList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asString.- Returns:
ListofStringobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toString.
-
asStringSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asString.- Returns:
SetofStringobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toString.
-
asIntegerList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asInteger.- Returns:
ListofIntegerobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toInteger.
-
asIntegerSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asInteger.- Returns:
SetofIntegerobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toInteger.
-
asShortList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asShort.- Returns:
ListofShortobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toShort.
-
asShortSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asShort.- Returns:
SetofShortobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toShort.
-
asLongList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asLong.- Returns:
ListofLongobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toLong.
-
asLongSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asLong.- Returns:
SetofLongobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toLong.
-
asFloatList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asFloat.- Returns:
ListofFloatobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toFloat.
-
asFloatSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asFloat.- Returns:
SetofFloatobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toFloat.
-
asDoubleList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asDouble.- Returns:
ListofDoubleobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toDouble.
-
asDoubleSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asDouble.- Returns:
SetofDoubleobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toDouble.
-
asBigIntegerList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asBigInteger.- Returns:
ListofBigIntegerobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toBigInteger.
-
asBigIntegerSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asBigInteger.- Returns:
SetofBigIntegerobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toBigInteger.
-
asBigDecimalList
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aListof all their values represented asBigDecimal.- Returns:
ListofBigDecimalobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aListor at least one element could not be cast toBigDecimal.
-
asBigDecimalSet
Assuming all elements within thisResultCollectionare instances ofResultPrimitive, this method returns aSetof all their values represented asBigDecimal.- Returns:
SetofBigDecimalobjects.- Throws:
UnsupportedOperationException- If this class does not support the creation of aSetor at least one element could not be cast toBigDecimal.
-