Package 

Class ImmutableStringValueImpl

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

    
    public class ImmutableStringValueImpl
    extends AbstractImmutableRawValue implements ImmutableStringValue
                        

    {@code ImmutableStringValueImpl} Implements {@code ImmutableStringValue} 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.
      ImmutableStringValue immutableValue() Returns immutable copy of this value.
      ImmutableStringValue asStringValue() Returns the value as {@code StringValue}.
      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, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, 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

      • ImmutableStringValueImpl

        ImmutableStringValueImpl(Array<byte> data)
      • ImmutableStringValueImpl

        ImmutableStringValueImpl(String string)
    • 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

         ImmutableStringValue immutableValue()

        Returns immutable copy of this value.

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

      • asStringValue

         ImmutableStringValue asStringValue()

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

        Note that you can't use instanceof or cast ((StringValue) 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}