public class DefaultResultCollection extends Object implements ResultCollection
| Constructor and Description |
|---|
DefaultResultCollection(Iterable<ResultElement> resultElements) |
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
asBigDecimal()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as BigDecimal. |
List<BigDecimal> |
asBigDecimalList()
Returns a list of values from this instance.
|
Set<BigDecimal> |
asBigDecimalSet()
Returns a set of values from this instance.
|
BigInteger |
asBigInteger()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as BigInteger. |
List<BigInteger> |
asBigIntegerList()
Returns a list of values from this instance.
|
Set<BigInteger> |
asBigIntegerSet()
Returns a set of values from this instance.
|
boolean |
asBoolean()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as boolean. |
List<Boolean> |
asBooleanList()
Returns a list of values from this instance.
|
Set<Boolean> |
asBooleanSet()
Returns a set of values from this instance.
|
byte |
asByte()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as byte. |
List<Byte> |
asByteList()
Returns a list of values from this instance.
|
Set<Byte> |
asByteSet()
Returns a set of values from this instance.
|
char |
asCharacter()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as char. |
List<Character> |
asCharacterList()
Returns a list of values from this instance.
|
Set<Character> |
asCharacterSet()
Returns a set of values from this instance.
|
double |
asDouble()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as double. |
List<Double> |
asDoubleList()
Returns a list of values from this instance.
|
Set<Double> |
asDoubleSet()
Returns a set of values from this instance.
|
float |
asFloat()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as float. |
List<Float> |
asFloatList()
Returns a list of values from this instance.
|
Set<Float> |
asFloatSet()
Returns a set of values from this instance.
|
int |
asInteger()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as int. |
List<Integer> |
asIntegerList()
Returns a list of values from this instance.
|
Set<Integer> |
asIntegerSet()
Returns a set of values from this instance.
|
<T> List<T> |
asList(Class<T> objectType)
Returns a list of values from this instance.
|
long |
asLong()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as long. |
List<Long> |
asLongList()
Returns a list of values from this instance.
|
Set<Long> |
asLongSet()
Returns a set of values from this instance.
|
<T> Set<T> |
asSet(Class<T> objectType)
Returns a set of values from this instance.
|
short |
asShort()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as short. |
List<Short> |
asShortList()
Returns a list of values from this instance.
|
Set<Short> |
asShortSet()
Returns a set of values from this instance.
|
String |
asString()
In case this
ResultElement is considered a ResultPrimitive, use this method to access its value
as String. |
List<String> |
asStringList()
Returns a list of values from this instance.
|
Set<String> |
asStringSet()
Returns a set of values from this instance.
|
protected boolean |
canEqual(Object other) |
CollectedResultCollection |
collect(String elementName)
Collects elements inside this
ResultCollection identified by filterName and returns a
CollectedResultCollection that contains only the collected elements. |
boolean |
equals(Object o) |
ResultCollection |
getAsCollection()
Returns this
ResultElement as an instance of ResultCollection. |
ResultObject |
getAsObject()
Returns this
ResultElement as an instance of ResultObject. |
ResultPrimitive |
getAsPrimitive()
Returns this
ResultElement as an instance of ResultPrimitive. |
Iterable<ResultElement> |
getResultElements() |
int |
hashCode() |
boolean |
isResultCollection()
Checks whether this
ResultElement represents a collection of result elements and, therefore, is a
ResultCollection. |
boolean |
isResultObject()
Checks whether this
ResultElement represents a structured object and, therefore, is a
ResultObject. |
boolean |
isResultPrimitive()
Checks whether this
ResultElement represents an unstructured value and, therefore, is a
ResultPrimitive. |
Iterator<ResultElement> |
iterator() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic DefaultResultCollection(Iterable<ResultElement> resultElements)
@Nonnull public CollectedResultCollection collect(@Nonnull String elementName)
ResultCollectionResultCollection identified by filterName and returns a
CollectedResultCollection that contains only the collected elements.collect in interface ResultCollectionelementName - The name used to identify the items to collect.CollectedResultCollection that contains only the collected elements.@Nonnull public <T> List<T> asList(@Nonnull Class<T> objectType) throws UnsupportedOperationException
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;
}
asList in interface ResultCollectionT - The type the elements in this collection object shall be casted to.objectType - The type into which the values should be converted.T.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public <T> Set<T> asSet(@Nonnull Class<T> objectType) throws UnsupportedOperationException
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;
}
asSet in interface ResultCollectionT - The type the elements in this collection object shall be casted to.objectType - The type into which the values should be converted.T.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<Boolean> asBooleanList() throws UnsupportedOperationException
Boolean.asBooleanList in interface ResultCollectionBoolean.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<Boolean> asBooleanSet() throws UnsupportedOperationException
Boolean.asBooleanSet in interface ResultCollectionBoolean.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<Byte> asByteList() throws UnsupportedOperationException
Byte.asByteList in interface ResultCollectionByte.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<Byte> asByteSet() throws UnsupportedOperationException
Byte.asByteSet in interface ResultCollectionByte.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<Character> asCharacterList() throws UnsupportedOperationException
Character.asCharacterList in interface ResultCollectionCharacter.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<Character> asCharacterSet() throws UnsupportedOperationException
Character.asCharacterSet in interface ResultCollectionCharacter.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<String> asStringList() throws UnsupportedOperationException
String.asStringList in interface ResultCollectionString.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<String> asStringSet() throws UnsupportedOperationException
String.asStringSet in interface ResultCollectionString.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<Integer> asIntegerList() throws UnsupportedOperationException
Integer.asIntegerList in interface ResultCollectionInteger.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<Integer> asIntegerSet() throws UnsupportedOperationException
Integer.asIntegerSet in interface ResultCollectionInteger.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<Short> asShortList() throws UnsupportedOperationException
Short.asShortList in interface ResultCollectionShort.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<Short> asShortSet() throws UnsupportedOperationException
Short.asShortSet in interface ResultCollectionShort.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<Long> asLongList() throws UnsupportedOperationException
Long.asLongList in interface ResultCollectionLong.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<Long> asLongSet() throws UnsupportedOperationException
Long.asLongSet in interface ResultCollectionLong.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<Float> asFloatList() throws UnsupportedOperationException
Float.asFloatList in interface ResultCollectionFloat.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<Float> asFloatSet() throws UnsupportedOperationException
Float.asFloatSet in interface ResultCollectionFloat.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<Double> asDoubleList() throws UnsupportedOperationException
Double.asDoubleList in interface ResultCollectionDouble.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<Double> asDoubleSet() throws UnsupportedOperationException
Double.asDoubleSet in interface ResultCollectionDouble.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<BigInteger> asBigIntegerList() throws UnsupportedOperationException
BigInteger.asBigIntegerList in interface ResultCollectionBigInteger.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<BigInteger> asBigIntegerSet() throws UnsupportedOperationException
BigInteger.asBigIntegerSet in interface ResultCollectionBigInteger.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public List<BigDecimal> asBigDecimalList() throws UnsupportedOperationException
BigDecimal.asBigDecimalList in interface ResultCollectionBigDecimal.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.@Nonnull public Set<BigDecimal> asBigDecimalSet() throws UnsupportedOperationException
BigDecimal.asBigDecimalSet in interface ResultCollectionBigDecimal.UnsupportedOperationException - If the value could not be found or could not be converted to the given type.public boolean isResultPrimitive()
ResultElementResultElement represents an unstructured value and, therefore, is a
ResultPrimitive.isResultPrimitive in interface ResultElementResultPrimitive, otherwise false.public boolean isResultCollection()
ResultElementResultElement represents a collection of result elements and, therefore, is a
ResultCollection.isResultCollection in interface ResultElementResultCollection, otherwise false.public boolean isResultObject()
ResultElementResultElement represents a structured object and, therefore, is a
ResultObject.isResultObject in interface ResultElementResultObject, otherwise false.@Nonnull public ResultPrimitive getAsPrimitive() throws UnsupportedOperationException
ResultElementResultElement as an instance of ResultPrimitive.getAsPrimitive in interface ResultElementResultPrimitive.UnsupportedOperationException - If the cast into ResultPrimitive failed, e.g. in case it is not a primitive.@Nonnull public ResultCollection getAsCollection()
ResultElementResultElement as an instance of ResultCollection.getAsCollection in interface ResultElementResultCollection.@Nonnull public ResultObject getAsObject() throws UnsupportedOperationException
ResultElementResultElement as an instance of ResultObject.getAsObject in interface ResultElementResultObject.UnsupportedOperationException - If the cast into ResultObject failed, e.g. in case it is not an object.public boolean asBoolean()
throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as boolean.asBoolean in interface ResultElementboolean value.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as boolean.public byte asByte()
throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as byte.asByte in interface ResultElementbyte value.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as byte.public char asCharacter()
throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as char.asCharacter in interface ResultElementchar value.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as char.@Nonnull public String asString() throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as String.asString in interface ResultElementString object.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as String.public int asInteger()
throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as int.asInteger in interface ResultElementint value.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as int.public short asShort()
throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as short.asShort in interface ResultElementshort value.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as short.public long asLong()
throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as long.asLong in interface ResultElementlong value.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as long.public float asFloat()
throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as float.asFloat in interface ResultElementfloat value.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as float.public double asDouble()
throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as double.asDouble in interface ResultElementdouble value.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as double.@Nonnull public BigInteger asBigInteger() throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as BigInteger.asBigInteger in interface ResultElementBigInteger object.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as BigInteger.@Nonnull public BigDecimal asBigDecimal() throws UnsupportedOperationException
ResultElementResultElement is considered a ResultPrimitive, use this method to access its value
as BigDecimal.asBigDecimal in interface ResultElementBigDecimal object.UnsupportedOperationException - If this ResultElement is not considered a ResultPrimitive or its value cannot be
represented as BigDecimal.@Nonnull public Iterator<ResultElement> iterator()
iterator in interface Iterable<ResultElement>public Iterable<ResultElement> getResultElements()
Copyright © 2021 SAP SE. All rights reserved.