Package com.sap.cloud.sdk.result
Class DefaultCollectedResultCollection
java.lang.Object
com.sap.cloud.sdk.result.DefaultCollectedResultCollection
- All Implemented Interfaces:
CollectedResultCollection
Default implementation of the
CollectedResultCollection
interface, allowing strongly typed access to specific
fields annotated with ElementName
in elements of a ResultCollection
.- See Also:
-
Constructor Summary
ConstructorDescriptionDefaultCollectedResultCollection
(String collectedElementName, Iterable<ResultElement> resultElements) Creates a newDefaultCollectedResultCollection
instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of values from this instance.Returns a set of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.<T> List<T>
Returns a list of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.<T> Set<T>
Returns a set of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.Returns a list of values from this instance.Returns a set of values from this instance.protected boolean
boolean
The common name of all elements addressed by this collection.int
hashCode()
iterator()
Returns an iterator over the elements of this collection.toString()
-
Constructor Details
-
DefaultCollectedResultCollection
public DefaultCollectedResultCollection(String collectedElementName, Iterable<ResultElement> resultElements) Creates a newDefaultCollectedResultCollection
instance.- Parameters:
collectedElementName
- The common name of all elements addressed by this collection.resultElements
-
-
-
Method Details
-
asList
@Nonnull public <T> List<T> asList(@Nonnull Class<T> objectType) throws UnsupportedOperationException Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented as an object of the given type.Important: In order to deserialize a result element to an object of a given type, you have to annotate all relevant field members of the respective class with
ElementName
. For example:class MyObject { @ElementName( "MANDT" ) SapClient sapClient; }
- Specified by:
asList
in interfaceCollectedResultCollection
- Type Parameters:
T
- The type into which the values should be converted.- Parameters:
objectType
- Class object of the type into which the values should be converted.- Returns:
- The list of values as objects of type
T
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented as an object of the given type.Important: In order to deserialize a result element to an object of a given type, you have to annotate all relevant field members of the respective class with
ElementName
. For example:class MyObject { @ElementName( "MANDT" ) SapClient sapClient; }
- Specified by:
asSet
in interfaceCollectedResultCollection
- Type Parameters:
T
- The type into which the values should be converted.- Parameters:
objectType
- Class object of the type into which the values should be converted.- Returns:
- The set of values as objects of type
T
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asBooleanList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asBoolean
.- Specified by:
asBooleanList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
Boolean
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asBooleanSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asBoolean
.- Specified by:
asBooleanSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
Boolean
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asByteList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asByte
.- Specified by:
asByteList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
Byte
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asByteSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asByte
.- Specified by:
asByteSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
Byte
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asCharacterList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asCharacter
.- Specified by:
asCharacterList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
Character
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asCharacterSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asCharacter
.- Specified by:
asCharacterSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
Character
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asStringList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asString
.- Specified by:
asStringList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
String
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asStringSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asString
.- Specified by:
asStringSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
String
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asIntegerList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asInteger
.- Specified by:
asIntegerList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
Integer
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asIntegerSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asInteger
.- Specified by:
asIntegerSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
Integer
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asShortList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asShort
.- Specified by:
asShortList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
Short
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asShortSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asShort
.- Specified by:
asShortSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
Short
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asLongList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asLong
.- Specified by:
asLongList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
Long
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asLongSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asLong
.- Specified by:
asLongSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
Long
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asFloatList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asFloat
.- Specified by:
asFloatList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
Float
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asFloatSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asFloat
.- Specified by:
asFloatSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
Float
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asDoubleList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asDouble
.- Specified by:
asDoubleList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
Double
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asDoubleSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asDouble
.- Specified by:
asDoubleSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
Double
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asBigIntegerList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asBigInteger
.- Specified by:
asBigIntegerList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
BigInteger
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asBigIntegerSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asBigInteger
.- Specified by:
asBigIntegerSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
BigInteger
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asBigDecimalList
Description copied from interface:CollectedResultCollection
Returns a list of values from this instance. The values are represented asBigDecimal
.- Specified by:
asBigDecimalList
in interfaceCollectedResultCollection
- Returns:
- The list of values as
BigDecimal
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
asBigDecimalSet
Description copied from interface:CollectedResultCollection
Returns a set of values from this instance. The values are represented asBigDecimal
.- Specified by:
asBigDecimalSet
in interfaceCollectedResultCollection
- Returns:
- The set of values as
BigDecimal
. - Throws:
UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.
-
iterator
Returns an iterator over the elements of this collection.- Returns:
- An iterator over the elements of this collection.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getCollectedElementName
The common name of all elements addressed by this collection. -
getResultElements
-