Package org.codehaus.jackson.io
Class SerializedString
- java.lang.Object
-
- org.codehaus.jackson.io.SerializedString
-
- All Implemented Interfaces:
SerializableString
public class SerializedString extends java.lang.Object implements 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
Fields Modifier and Type Field Description protected char[]_quotedCharsprotected byte[]_quotedUTF8Refprotected byte[]_unquotedUTF8Refprotected java.lang.String_value
-
Constructor Summary
Constructors Constructor Description SerializedString(java.lang.String v)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char[]asQuotedChars()Returns JSON quoted form of the String, as character array.byte[]asQuotedUTF8()Accessor for accessing value as is (without JSON quoting) encoded using UTF-8 encoding.byte[]asUnquotedUTF8()Accessor for accessing value that has been quoted using JSON quoting rules, and encoded using UTF-8 encoding.intcharLength()Returns length of the String as charactersbooleanequals(java.lang.Object o)java.lang.StringgetValue()Returns unquoted String that this object represents (and offers serialized forms for)inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getValue
public final java.lang.String getValue()
Description copied from interface:SerializableStringReturns unquoted String that this object represents (and offers serialized forms for)- Specified by:
getValuein interfaceSerializableString
-
charLength
public final int charLength()
Returns length of the String as characters- Specified by:
charLengthin interfaceSerializableString
-
asQuotedChars
public final char[] asQuotedChars()
Description copied from interface:SerializableStringReturns 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:
asQuotedCharsin 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:
asUnquotedUTF8in interfaceSerializableString
-
asQuotedUTF8
public final byte[] asQuotedUTF8()
Accessor for accessing value as is (without JSON quoting) encoded using UTF-8 encoding.- Specified by:
asQuotedUTF8in interfaceSerializableString
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-