public class GsonResultPrimitive extends Object implements ResultPrimitive
Constructor and Description |
---|
GsonResultPrimitive(com.google.gson.JsonPrimitive jsonPrimitive) |
Modifier and Type | Method and Description |
---|---|
BigDecimal |
asBigDecimal()
Returns a value from this element.
|
BigInteger |
asBigInteger()
Returns a value from this element.
|
boolean |
asBoolean()
Returns a value from this element.
|
byte |
asByte()
Returns a value from this element.
|
char |
asCharacter()
Returns a value from this element.
|
double |
asDouble()
Returns a value from this element.
|
float |
asFloat()
Returns a value from this element.
|
int |
asInteger()
Returns a value from this element.
|
long |
asLong()
Returns a value from this element.
|
short |
asShort()
Returns a value from this element.
|
String |
asString()
Returns a value from this element.
|
boolean |
equals(Object o) |
ResultCollection |
getAsCollection() |
ResultObject |
getAsObject() |
ResultPrimitive |
getAsPrimitive() |
com.google.gson.JsonPrimitive |
getJsonPrimitive() |
int |
hashCode() |
boolean |
isResultCollection() |
boolean |
isResultObject() |
boolean |
isResultPrimitive() |
String |
toString() |
@ConstructorProperties(value="jsonPrimitive") @Generated(value="lombok") public GsonResultPrimitive(com.google.gson.JsonPrimitive jsonPrimitive)
public boolean isResultPrimitive()
isResultPrimitive
in interface ResultElement
public boolean isResultCollection()
isResultCollection
in interface ResultElement
public boolean isResultObject()
isResultObject
in interface ResultElement
public ResultPrimitive getAsPrimitive()
getAsPrimitive
in interface ResultElement
public ResultCollection getAsCollection() throws UnsupportedOperationException
getAsCollection
in interface ResultElement
UnsupportedOperationException
public ResultObject getAsObject() throws UnsupportedOperationException
getAsObject
in interface ResultElement
UnsupportedOperationException
public boolean asBoolean() throws UnsupportedOperationException
boolean
.asBoolean
in interface ResultElement
asBoolean
in interface ResultPrimitive
boolean
.UnsupportedOperationException
- If the value could not be converted to the given type.public byte asByte() throws UnsupportedOperationException
byte
.asByte
in interface ResultElement
asByte
in interface ResultPrimitive
byte
.UnsupportedOperationException
- If the value could not be converted to the given type.public char asCharacter() throws UnsupportedOperationException
char
.asCharacter
in interface ResultElement
asCharacter
in interface ResultPrimitive
char
.UnsupportedOperationException
- If the value could not be converted to the given type.public String asString() throws UnsupportedOperationException
String
.asString
in interface ResultElement
asString
in interface ResultPrimitive
String
.UnsupportedOperationException
- If the value could not be converted to the given type.public int asInteger() throws UnsupportedOperationException
int
.asInteger
in interface ResultElement
asInteger
in interface ResultPrimitive
int
.UnsupportedOperationException
- If the value could not be converted to the given type.public short asShort() throws UnsupportedOperationException
short
.asShort
in interface ResultElement
asShort
in interface ResultPrimitive
short
.UnsupportedOperationException
- If the value could not be converted to the given type.public long asLong() throws UnsupportedOperationException
long
.asLong
in interface ResultElement
asLong
in interface ResultPrimitive
long
.UnsupportedOperationException
- If the value could not be converted to the given type.public float asFloat() throws UnsupportedOperationException
float
.asFloat
in interface ResultElement
asFloat
in interface ResultPrimitive
float
.UnsupportedOperationException
- If the value could not be converted to the given type.public double asDouble() throws UnsupportedOperationException
double
.asDouble
in interface ResultElement
asDouble
in interface ResultPrimitive
double
.UnsupportedOperationException
- If the value could not be converted to the given type.public BigInteger asBigInteger() throws UnsupportedOperationException
BigInteger
.asBigInteger
in interface ResultElement
asBigInteger
in interface ResultPrimitive
BigInteger
.UnsupportedOperationException
- If the value could not be converted to the given type.public BigDecimal asBigDecimal() throws UnsupportedOperationException
BigDecimal
.asBigDecimal
in interface ResultElement
asBigDecimal
in interface ResultPrimitive
BigDecimal
.UnsupportedOperationException
- If the value could not be converted to the given type.@Generated(value="lombok") public com.google.gson.JsonPrimitive getJsonPrimitive()
@Generated(value="lombok") public boolean equals(Object o)
@Generated(value="lombok") public int hashCode()
@Generated(value="lombok") public String toString()
Copyright © 2017 SAP SE. All rights reserved.