@ProviderType
public final class TypedValues
extends java.lang.Object
TypedValue
Modifier and Type | Method and Description |
---|---|
static BooleanValue |
newBooleanValue(boolean value)
Creates new boolean value.
|
static ByteArrayValue |
newByteArrayValue(byte[] value)
Creates new byte array value.
|
static DoubleValue |
newDoubleValue(double value)
Creates new double value.
|
static FloatValue |
newFloatValue(float value)
Creates new float value.
|
static IntegerValue |
newIntegerValue(int value)
Creates new integer value.
|
static LongValue |
newLongValue(long value)
Creates new long value.
|
static StringValue |
newStringValue(java.lang.String value)
Creates new string value.
|
static TypedValue<?> |
newTypedValue(java.lang.Object value)
Creates new TypedValue inferring the type from the argument.
|
static TypedValue<?> |
parseTypedValue(DataType type,
java.lang.String value)
Parses a TypedValue of given type from a String.
|
public static BooleanValue newBooleanValue(boolean value)
value
- the primitive boolean valueTypedValue
public static ByteArrayValue newByteArrayValue(byte[] value)
value
- the primitive byte array valueTypedValue
KuraRuntimeException
- if the argument is nullpublic static FloatValue newFloatValue(float value)
value
- the primitive float valueTypedValue
public static DoubleValue newDoubleValue(double value)
value
- the primitive double valueTypedValue
public static IntegerValue newIntegerValue(int value)
value
- the primitive integer valueTypedValue
public static LongValue newLongValue(long value)
value
- the primitive long valueTypedValue
public static StringValue newStringValue(@Nullable java.lang.String value)
value
- the string value to be represented as TypedValue
TypedValue
public static TypedValue<?> newTypedValue(java.lang.Object value)
value
- an object that needs to be represented as TypedValue
TypedValue
that represents the conversion of value
java.lang.IllegalArgumentException
- if value
cannot be represented as TypedValue
public static TypedValue<?> parseTypedValue(DataType type, java.lang.String value)
value
- the String to be parsed into a TypedValue
type
- the DataType
of the returned TypedValue
TypedValue
that represents the conversion of value
java.lang.IllegalArgumentException
- if value
cannot be represented as TypedValue