Package org.codehaus.jackson.io
Class SerializedString
java.lang.Object
org.codehaus.jackson.io.SerializedString
- All Implemented Interfaces:
SerializableString
String token that can lazily serialize String contained and then reuse that
serialization later on. This is similar to JDBC prepared statements, for example,
in that instances should only be created when they are used more than use;
prime candidates are various serializers.
Class is final for performance reasons and since this is not designed to be extensible or customizable (customizations would occur in calling code)
- Since:
- 1.6
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected char[]
protected byte[]
protected byte[]
protected final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal char[]
Returns JSON quoted form of the String, as character array.final byte[]
Accessor for accessing value as is (without JSON quoting) encoded using UTF-8 encoding.final byte[]
Accessor for accessing value that has been quoted using JSON quoting rules, and encoded using UTF-8 encoding.final int
Returns length of the String as charactersfinal boolean
final String
getValue()
Returns unquoted String that this object represents (and offers serialized forms for)final int
hashCode()
final String
toString()
-
Field Details
-
_value
-
_quotedUTF8Ref
protected byte[] _quotedUTF8Ref -
_unquotedUTF8Ref
protected byte[] _unquotedUTF8Ref -
_quotedChars
protected char[] _quotedChars
-
-
Constructor Details
-
SerializedString
-
-
Method Details
-
getValue
Description copied from interface:SerializableString
Returns unquoted String that this object represents (and offers serialized forms for)- Specified by:
getValue
in interfaceSerializableString
-
charLength
public final int charLength()Returns length of the String as characters- Specified by:
charLength
in interfaceSerializableString
-
asQuotedChars
public final char[] asQuotedChars()Description copied from interface:SerializableString
Returns JSON quoted form of the String, as character array. Result can be embedded as-is in textual JSON as property name or JSON String.- Specified by:
asQuotedChars
in interfaceSerializableString
-
asUnquotedUTF8
public final byte[] asUnquotedUTF8()Accessor for accessing value that has been quoted using JSON quoting rules, and encoded using UTF-8 encoding.- Specified by:
asUnquotedUTF8
in interfaceSerializableString
-
asQuotedUTF8
public final byte[] asQuotedUTF8()Accessor for accessing value as is (without JSON quoting) encoded using UTF-8 encoding.- Specified by:
asQuotedUTF8
in interfaceSerializableString
-
toString
-
hashCode
public final int hashCode() -
equals
-