Class CompressedString

All Implemented Interfaces:
StringAlike<CompressedString>, StringCompatible, Serializable, CharSequence, Comparable<CharSequence>

public final class CompressedString extends AbstractCompressedString<CompressedString>
Immutable byte[]-backed String replacement.
See Also:
  • Constructor Details

    • CompressedString

      public CompressedString()
    • CompressedString

      public CompressedString(String data)
    • CompressedString

      public CompressedString(char[] data, int offset, int length)
    • CompressedString

      public CompressedString(char[] data)
    • CompressedString

      public CompressedString(ByteBuffer data, int offset, int length)
    • CompressedString

      public CompressedString(ByteBuffer data)
    • CompressedString

      public CompressedString(byte[] data, int offset, int length)
    • CompressedString

      public CompressedString(byte[] data)
  • Method Details

    • toCompressedString

      @NotNull public @NotNull CompressedString toCompressedString()
      Description copied from interface: StringCompatible
      Convert this StringCompatible into a CompressedString. Implementations should not cache result CompressedStrings, in order to avoid inadvertently allowing promotion of short-lived objects under generational garbage collection.
      Returns:
      A newly constructed CompressedString representing the same sequence of characters as this StringCompatible (or this object, if appropriate).
    • toMappedCompressedString

      @NotNull public @NotNull MappedCompressedString toMappedCompressedString()
      Description copied from interface: StringCompatible
      Convert this StringCompatible into a MappedCompressedString. Implementations should not cache result CompressedStrings, in order to avoid inadvertently allowing promotion of short-lived objects under generational garbage collection.
      Returns:
      A newly constructed MappedCompressedString representing the same sequence of characters as this StringCompatible (or this object, if appropriate).
    • convertValue

      protected final CompressedString convertValue(String string)
      Description copied from class: AbstractCompressedString
      Convert a String to this type.
      Specified by:
      convertValue in class AbstractCompressedString<CompressedString>
      Parameters:
      string - The String to convert
      Returns:
      A new TYPE with the same contents as String, assuming ISO-8859-1 encoding
    • convertValue

      protected final CompressedString convertValue(byte[] data, int offset, int length)
      Description copied from class: AbstractCompressedString
      Convert a byte array to this type, assuming ISO-8859-1
      Specified by:
      convertValue in class AbstractCompressedString<CompressedString>
      Parameters:
      data - The data to convert
      offset - The starting index from data to convert
      length - The length to convert
      Returns:
      A new TYPE with the same contents as the specified region of data, assuming ISO-8859-1 encoding
    • compress

      public static CompressedString compress(String value)
      Helper to be statically imported for groovy scripting.
      Parameters:
      value - The String to convert
      Returns:
      A new CompressedString with the same contents as value, assuming ISO-8859-1 encoding