org.codehaus.jackson.SerializableString Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ehcache Show documentation
Show all versions of ehcache Show documentation
Ehcache is an open source, standards-based cache used to boost performance,
offload the database and simplify scalability. Ehcache is robust, proven and full-featured and
this has made it the most widely-used Java-based cache.
package org.codehaus.jackson;
/**
* Interface that defines how Jackson package can interact with efficient
* pre-serialized or lazily-serialized and reused String representations.
* Typically implementations store possible serialized version(s) so that
* serialization of String can be done more efficiently, especially when
* used multiple times.
*
* @since 1.7 (1.6 introduced implementation, but interface extracted later)
*
* @see org.codehaus.jackson.io.SerializedString
*/
public interface SerializableString
{
/**
* Returns unquoted String that this object represents (and offers
* serialized forms for)
*/
public String getValue();
/**
* Returns length of the (unquoted) String as characters.
* Functionally equvalent to:
*
* getValue().length();
*
*/
public int charLength();
/**
* 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.
*/
public char[] asQuotedChars();
/**
* Returns UTF-8 encoded version of unquoted String.
* Functionally equivalent to (but more efficient than):
*
* getValue().getBytes("UTF-8");
*
*/
public byte[] asUnquotedUTF8();
/**
* Returns UTF-8 encoded version of JSON-quoted String.
* Functionally equivalent to (but more efficient than):
*
* new String(asQuotedChars()).getBytes("UTF-8");
*
*/
public byte[] asQuotedUTF8();
}