public interface ResultElement
Note that accessing the result element varies depending on its structure:
ResultPrimitive
. ResultObject
. ResultCollection
. isResultPrimitive()
, isResultObject()
, or isResultCollection()
to check
for the respective case.
As accessing the content of the result element varies depending on its structure, use the methods
getAsPrimitive()
, getAsObject()
, or getAsCollection()
to access the result element
content.
If the result element is considered a ResultPrimitive
, its content can be accessed with the respective method
directly, such as asString()
to obtain the result element content as String object.
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 . |
BigInteger |
asBigInteger()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as BigInteger . |
boolean |
asBoolean()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as boolean . |
byte |
asByte()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as byte . |
char |
asCharacter()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as char . |
double |
asDouble()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as double . |
float |
asFloat()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as float . |
int |
asInteger()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as int . |
long |
asLong()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as long . |
short |
asShort()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as short . |
String |
asString()
In case this
ResultElement is considered a ResultPrimitive , use this method to access its value
as String . |
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 . |
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 . |
boolean isResultPrimitive()
ResultElement
represents an unstructured value and, therefore, is a
ResultPrimitive
.ResultPrimitive
, otherwise false.boolean isResultCollection()
ResultElement
represents a collection of result elements and, therefore, is a
ResultCollection
.ResultCollection
, otherwise false.boolean isResultObject()
ResultElement
represents a structured object and, therefore, is a
ResultObject
.ResultObject
, otherwise false.@Nonnull ResultPrimitive getAsPrimitive() throws UnsupportedOperationException
ResultElement
as an instance of ResultPrimitive
.ResultPrimitive
.UnsupportedOperationException
- If the cast into ResultPrimitive
failed, e.g. in case it is not a primitive.@Nonnull ResultCollection getAsCollection() throws UnsupportedOperationException
ResultElement
as an instance of ResultCollection
.ResultCollection
.UnsupportedOperationException
- If the cast into ResultCollection
failed, e.g. in case it is not a collection.@Nonnull ResultObject getAsObject() throws UnsupportedOperationException
ResultElement
as an instance of ResultObject
.ResultObject
.UnsupportedOperationException
- If the cast into ResultObject
failed, e.g. in case it is not an object.boolean asBoolean() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as boolean
.boolean
value.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as boolean
.byte asByte() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as byte
.byte
value.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as byte
.char asCharacter() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as char
.char
value.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as char
.@Nonnull String asString() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as String
.String
object.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as String
.int asInteger() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as int
.int
value.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as int
.short asShort() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as short
.short
value.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as short
.long asLong() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as long
.long
value.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as long
.float asFloat() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as float
.float
value.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as float
.double asDouble() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as double
.double
value.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as double
.@Nonnull BigInteger asBigInteger() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as BigInteger
.BigInteger
object.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as BigInteger
.@Nonnull BigDecimal asBigDecimal() throws UnsupportedOperationException
ResultElement
is considered a ResultPrimitive
, use this method to access its value
as BigDecimal
.BigDecimal
object.UnsupportedOperationException
- If this ResultElement
is not considered a ResultPrimitive
or its value cannot be
represented as BigDecimal
.Copyright © 2019 SAP SE. All rights reserved.