Package 

Class ImmutableBinaryValueImpl

  • All Implemented Interfaces:
    com.batch.android.msgpack.value.BinaryValue , com.batch.android.msgpack.value.ImmutableBinaryValue , com.batch.android.msgpack.value.ImmutableRawValue , com.batch.android.msgpack.value.ImmutableValue , com.batch.android.msgpack.value.RawValue , com.batch.android.msgpack.value.Value

    
    public class ImmutableBinaryValueImpl
    extends AbstractImmutableRawValue implements ImmutableBinaryValue
                        

    {@code ImmutableBinaryValueImpl} Implements {@code ImmutableBinaryValue} using a {@code byte[]} field. This implementation caches result of {@code toString()} and {@code asString()} using a private {@code String} field.

    • Method Summary

      Modifier and Type Method Description
      ValueType getValueType() Returns type of this value.
      ImmutableBinaryValue immutableValue() Returns immutable copy of this value.
      ImmutableBinaryValue asBinaryValue() Returns the value as {@code BinaryValue}.
      void writeTo(MessagePacker pk) Serializes the value using the specified {@code MessagePacker}
      boolean equals(Object o)
      int hashCode()
      • Methods inherited from class com.batch.android.msgpack.value.impl.AbstractImmutableRawValue

        asByteArray, asByteBuffer, asRawValue, asString, toJson, toString
      • Methods inherited from class com.batch.android.msgpack.value.impl.AbstractImmutableValue

        asArrayValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, 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

      • ImmutableBinaryValueImpl

        ImmutableBinaryValueImpl(Array<byte> data)
    • 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.

      • immutableValue

         ImmutableBinaryValue immutableValue()

        Returns immutable copy of this value.

        This method simply returns this without copying the value if this value is already immutable.

      • asBinaryValue

         ImmutableBinaryValue asBinaryValue()

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

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

      • writeTo

         void writeTo(MessagePacker pk)

        Serializes the value using the specified {@code MessagePacker}