Package 

Class ImmutableDoubleValueImpl

  • All Implemented Interfaces:
    com.batch.android.msgpack.value.FloatValue , com.batch.android.msgpack.value.ImmutableFloatValue , com.batch.android.msgpack.value.ImmutableNumberValue , com.batch.android.msgpack.value.ImmutableValue , com.batch.android.msgpack.value.NumberValue , com.batch.android.msgpack.value.Value

    
    public class ImmutableDoubleValueImpl
    extends AbstractImmutableValue implements ImmutableFloatValue
                        

    {@code ImmutableDoubleValueImpl} Implements {@code ImmutableFloatValue} using a {@code double} field.

    • Method Summary

      Modifier and Type Method Description
      ValueType getValueType() Returns type of this value.
      ImmutableDoubleValueImpl immutableValue() Returns immutable copy of this value.
      ImmutableNumberValue asNumberValue() Returns the value as {@code NumberValue}.
      ImmutableFloatValue asFloatValue() Returns the value as {@code FloatValue}.
      byte toByte() Represent this value as a byte value, which may involve rounding or truncation of the original value.the value.
      short toShort() Represent this value as a short value, which may involve rounding or truncation of the original value.
      int toInt() Represent this value as an int value, which may involve rounding or truncation of the original value.value.
      long toLong() Represent this value as a long value, which may involve rounding or truncation of the original value.
      BigInteger toBigInteger() Represent this value as a BigInteger, which may involve rounding or truncation of the original value.
      float toFloat() Represent this value as a 32-bit float value, which may involve rounding or truncation of the original value.
      double toDouble() Represent this value as a 64-bit double value, which may involve rounding or truncation of the original value.
      void writeTo(MessagePacker pk) Serializes the value using the specified {@code MessagePacker}
      boolean equals(Object o)
      int hashCode()
      String toJson() Returns json representation of this Value.
      String toString()
      • Methods inherited from class com.batch.android.msgpack.value.impl.AbstractImmutableValue

        asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asIntegerValue, asMapValue, asNilValue, asRawValue, asStringValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue
      • Methods inherited from class com.batch.android.msgpack.value.Value

        asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, equals, immutableValue
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImmutableDoubleValueImpl

        ImmutableDoubleValueImpl(double value)
    • Method Detail

      • getValueType

         ValueType getValueType()

        Returns type of this value.

        Note that you can't use instanceof to check type of a value because type of a mutable value is variable.

      • asNumberValue

         ImmutableNumberValue asNumberValue()

        Returns the value as {@code NumberValue}. Otherwise throws {@code MessageTypeCastException}.

        Note that you can't use instanceof or cast ((NumberValue) thisValue) to check type of a value because type of a mutable value is variable.

      • asFloatValue

         ImmutableFloatValue asFloatValue()

        Returns the value as {@code FloatValue}. Otherwise throws {@code MessageTypeCastException}.

        Note that you can't use instanceof or cast ((FloatValue) thisValue) to check type of a value because type of a mutable value is variable.

      • toByte

         byte toByte()

        Represent this value as a byte value, which may involve rounding or truncation of the original value.the value.

      • toShort

         short toShort()

        Represent this value as a short value, which may involve rounding or truncation of the original value.

      • toInt

         int toInt()

        Represent this value as an int value, which may involve rounding or truncation of the original value.value.

      • toLong

         long toLong()

        Represent this value as a long value, which may involve rounding or truncation of the original value.

      • toBigInteger

         BigInteger toBigInteger()

        Represent this value as a BigInteger, which may involve rounding or truncation of the original value.

      • toFloat

         float toFloat()

        Represent this value as a 32-bit float value, which may involve rounding or truncation of the original value.

      • toDouble

         double toDouble()

        Represent this value as a 64-bit double value, which may involve rounding or truncation of the original value.

      • writeTo

         void writeTo(MessagePacker pk)

        Serializes the value using the specified {@code MessagePacker}

      • toJson

         String toJson()

        Returns json representation of this Value.

        Following behavior is not configurable at this release and they might be changed at future releases:

        • if a key of MapValue is not string, the key is converted to a string using toString method.
        • NaN and Infinity of DoubleValue are converted to null.
        • ExtensionValue is converted to a 2-element array where first element is a number and second element is the data encoded in hex.
        • BinaryValue is converted to a string using UTF-8 encoding. Invalid byte sequence is replaced with U+FFFD replacement character.
        • Invalid UTF-8 byte sequences in StringValue is replaced with U+FFFD replacement character