Package rocks.xmpp.extensions.rpc.model
Class Value
- java.lang.Object
-
- rocks.xmpp.extensions.rpc.model.Value
-
public final class Value extends Object
The value type, which is used by XML-RPC.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
List<Value>
getAsArray()
Gets the value as array or null.boolean
getAsBoolean()
Gets the value as boolean.byte[]
getAsByteArray()
Gets the value as byte array or null.Double
getAsDouble()
Gets the value as double or null.OffsetDateTime
getAsInstant()
Gets the value as date or null.Integer
getAsInteger()
Gets the value as integer or null.Map<String,Value>
getAsMap()
Gets the value as map or null.String
getAsString()
Gets the value as string or null.int
hashCode()
static Value
of(boolean b)
Creates a boolean value.static Value
of(byte[] bytes)
Creates a binary (base64) value.static Value
of(Double d)
Creates a double value.static Value
of(Integer integer)
Creates an integer value.static Value
of(String string)
Creates a string value.static Value
of(OffsetDateTime dateTime)
Creates a date value.static Value
of(Collection<Value> list)
Creates an array type value.static Value
of(Map<String,Value> map)
Creates a struct type value.String
toString()
-
-
-
Method Detail
-
of
public static Value of(Integer integer)
Creates an integer value.- Parameters:
integer
- The integer value.- Returns:
- The value element.
-
of
public static Value of(String string)
Creates a string value.- Parameters:
string
- The string value.- Returns:
- The value element.
-
of
public static Value of(Double d)
Creates a double value.- Parameters:
d
- The double value.- Returns:
- The value element.
-
of
public static Value of(byte[] bytes)
Creates a binary (base64) value.- Parameters:
bytes
- The binary value.- Returns:
- The value element.
-
of
public static Value of(boolean b)
Creates a boolean value.- Parameters:
b
- The boolean value.- Returns:
- The value element.
-
of
public static Value of(OffsetDateTime dateTime)
Creates a date value.- Parameters:
dateTime
- The date time value.- Returns:
- The value element.
-
of
public static Value of(Collection<Value> list)
Creates an array type value.- Parameters:
list
- The array type value.- Returns:
- The value element.
-
of
public static Value of(Map<String,Value> map)
Creates a struct type value.- Parameters:
map
- The struct type value.- Returns:
- The value element.
-
getAsInteger
public final Integer getAsInteger()
Gets the value as integer or null.- Returns:
- The integer or null.
-
getAsDouble
public final Double getAsDouble()
Gets the value as double or null.- Returns:
- The double or null.
-
getAsString
public final String getAsString()
Gets the value as string or null.- Returns:
- The string or null.
-
getAsByteArray
public final byte[] getAsByteArray()
Gets the value as byte array or null.- Returns:
- The byte array or null.
-
getAsBoolean
public final boolean getAsBoolean()
Gets the value as boolean.- Returns:
- The boolean.
-
getAsInstant
public final OffsetDateTime getAsInstant()
Gets the value as date or null.- Returns:
- The date or null.
-
getAsArray
public final List<Value> getAsArray()
Gets the value as array or null.- Returns:
- The array or null.
-
getAsMap
public final Map<String,Value> getAsMap()
Gets the value as map or null.- Returns:
- The map or null.
-
-