public class DefaultResultCollection extends Object implements ResultCollection
Constructor and Description |
---|
DefaultResultCollection(Iterable<ResultElement> resultElements) |
Modifier and Type | Method and Description |
---|---|
BigDecimal |
asBigDecimal() |
List<BigDecimal> |
asBigDecimalList()
Returns a list of values from this instance.
|
Set<BigDecimal> |
asBigDecimalSet()
Returns a set of values from this instance.
|
BigInteger |
asBigInteger() |
List<BigInteger> |
asBigIntegerList()
Returns a list of values from this instance.
|
Set<BigInteger> |
asBigIntegerSet()
Returns a set of values from this instance.
|
boolean |
asBoolean() |
List<Boolean> |
asBooleanList()
Returns a list of values from this instance.
|
Set<Boolean> |
asBooleanSet()
Returns a set of values from this instance.
|
byte |
asByte() |
List<Byte> |
asByteList()
Returns a list of values from this instance.
|
Set<Byte> |
asByteSet()
Returns a set of values from this instance.
|
char |
asCharacter() |
List<Character> |
asCharacterList()
Returns a list of values from this instance.
|
Set<Character> |
asCharacterSet()
Returns a set of values from this instance.
|
double |
asDouble() |
List<Double> |
asDoubleList()
Returns a list of values from this instance.
|
Set<Double> |
asDoubleSet()
Returns a set of values from this instance.
|
float |
asFloat() |
List<Float> |
asFloatList()
Returns a list of values from this instance.
|
Set<Float> |
asFloatSet()
Returns a set of values from this instance.
|
int |
asInteger() |
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() |
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() |
List<Short> |
asShortList()
Returns a list of values from this instance.
|
Set<Short> |
asShortSet()
Returns a set of values from this instance.
|
String |
asString() |
List<String> |
asStringList()
Returns a list of values from this instance.
|
Set<String> |
asStringSet()
Returns a set of values from this instance.
|
CollectedResultCollection |
collect(String elementName) |
boolean |
equals(Object o) |
ResultCollection |
getAsCollection() |
ResultObject |
getAsObject() |
ResultPrimitive |
getAsPrimitive() |
Iterable<ResultElement> |
getResultElements() |
int |
hashCode() |
boolean |
isResultCollection() |
boolean |
isResultObject() |
boolean |
isResultPrimitive() |
Iterator<ResultElement> |
iterator() |
String |
toString() |
@ConstructorProperties(value="resultElements") @Generated(value="lombok") public DefaultResultCollection(Iterable<ResultElement> resultElements)
public CollectedResultCollection collect(String elementName)
collect
in interface ResultCollection
public <T> List<T> asList(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 ResultCollection
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.public <T> Set<T> asSet(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 ResultCollection
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.public List<Boolean> asBooleanList() throws UnsupportedOperationException
Boolean
.asBooleanList
in interface ResultCollection
Boolean
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<Boolean> asBooleanSet() throws UnsupportedOperationException
Boolean
.asBooleanSet
in interface ResultCollection
Boolean
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<Byte> asByteList() throws UnsupportedOperationException
Byte
.asByteList
in interface ResultCollection
Byte
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<Byte> asByteSet() throws UnsupportedOperationException
Byte
.asByteSet
in interface ResultCollection
Byte
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<Character> asCharacterList() throws UnsupportedOperationException
Character
.asCharacterList
in interface ResultCollection
Character
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<Character> asCharacterSet() throws UnsupportedOperationException
Character
.asCharacterSet
in interface ResultCollection
Character
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<String> asStringList() throws UnsupportedOperationException
String
.asStringList
in interface ResultCollection
String
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<String> asStringSet() throws UnsupportedOperationException
String
.asStringSet
in interface ResultCollection
String
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<Integer> asIntegerList() throws UnsupportedOperationException
Integer
.asIntegerList
in interface ResultCollection
Integer
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<Integer> asIntegerSet() throws UnsupportedOperationException
Integer
.asIntegerSet
in interface ResultCollection
Integer
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<Short> asShortList() throws UnsupportedOperationException
Short
.asShortList
in interface ResultCollection
Short
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<Short> asShortSet() throws UnsupportedOperationException
Short
.asShortSet
in interface ResultCollection
Short
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<Long> asLongList() throws UnsupportedOperationException
Long
.asLongList
in interface ResultCollection
Long
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<Long> asLongSet() throws UnsupportedOperationException
Long
.asLongSet
in interface ResultCollection
Long
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<Float> asFloatList() throws UnsupportedOperationException
Float
.asFloatList
in interface ResultCollection
Float
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<Float> asFloatSet() throws UnsupportedOperationException
Float
.asFloatSet
in interface ResultCollection
Float
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<Double> asDoubleList() throws UnsupportedOperationException
Double
.asDoubleList
in interface ResultCollection
Double
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<Double> asDoubleSet() throws UnsupportedOperationException
Double
.asDoubleSet
in interface ResultCollection
Double
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<BigInteger> asBigIntegerList() throws UnsupportedOperationException
BigInteger
.asBigIntegerList
in interface ResultCollection
BigInteger
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<BigInteger> asBigIntegerSet() throws UnsupportedOperationException
BigInteger
.asBigIntegerSet
in interface ResultCollection
BigInteger
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public List<BigDecimal> asBigDecimalList() throws UnsupportedOperationException
BigDecimal
.asBigDecimalList
in interface ResultCollection
BigDecimal
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public Set<BigDecimal> asBigDecimalSet() throws UnsupportedOperationException
BigDecimal
.asBigDecimalSet
in interface ResultCollection
BigDecimal
.UnsupportedOperationException
- If the value could not be found or could not be converted to the given type.public boolean isResultPrimitive()
isResultPrimitive
in interface ResultElement
public boolean isResultCollection()
isResultCollection
in interface ResultElement
public boolean isResultObject()
isResultObject
in interface ResultElement
public ResultPrimitive getAsPrimitive() throws UnsupportedOperationException
getAsPrimitive
in interface ResultElement
UnsupportedOperationException
public ResultCollection getAsCollection()
getAsCollection
in interface ResultElement
public ResultObject getAsObject() throws UnsupportedOperationException
getAsObject
in interface ResultElement
UnsupportedOperationException
public boolean asBoolean() throws UnsupportedOperationException
asBoolean
in interface ResultElement
UnsupportedOperationException
public byte asByte() throws UnsupportedOperationException
asByte
in interface ResultElement
UnsupportedOperationException
public char asCharacter() throws UnsupportedOperationException
asCharacter
in interface ResultElement
UnsupportedOperationException
public String asString() throws UnsupportedOperationException
asString
in interface ResultElement
UnsupportedOperationException
public int asInteger() throws UnsupportedOperationException
asInteger
in interface ResultElement
UnsupportedOperationException
public short asShort() throws UnsupportedOperationException
asShort
in interface ResultElement
UnsupportedOperationException
public long asLong() throws UnsupportedOperationException
asLong
in interface ResultElement
UnsupportedOperationException
public float asFloat() throws UnsupportedOperationException
asFloat
in interface ResultElement
UnsupportedOperationException
public double asDouble() throws UnsupportedOperationException
asDouble
in interface ResultElement
UnsupportedOperationException
public BigInteger asBigInteger() throws UnsupportedOperationException
asBigInteger
in interface ResultElement
UnsupportedOperationException
public BigDecimal asBigDecimal() throws UnsupportedOperationException
asBigDecimal
in interface ResultElement
UnsupportedOperationException
public Iterator<ResultElement> iterator()
iterator
in interface Iterable<ResultElement>
@Generated(value="lombok") public boolean equals(Object o)
@Generated(value="lombok") public int hashCode()
@Generated(value="lombok") public String toString()
@Generated(value="lombok") public Iterable<ResultElement> getResultElements()
Copyright © 2017 SAP SE. All rights reserved.