Package io.deephaven.base.string.cache
Class StringCacheTypeAdapterCompressedStringImpl
java.lang.Object
io.deephaven.base.string.cache.StringCacheTypeAdapterCompressedStringImpl
- All Implemented Interfaces:
StringCacheTypeAdapter<CompressedString>
public class StringCacheTypeAdapterCompressedStringImpl
extends Object
implements StringCacheTypeAdapter<CompressedString>
Type adapter for CompressedStrings.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
areEqual
(@NotNull CharSequence key, @NotNull CompressedString value) Compare key (Assumed to be a String *or* a StringCompatible) with value (created by this factory).final @NotNull CompressedString
create
(@NotNull StringCompatible protoString) Note: StringCache implementations may choose not hold a lock while invoking this method.final @NotNull CompressedString
Note: StringCache implementations may choose not hold a lock while invoking this method.final @NotNull CompressedString
empty()
final @NotNull Class<CompressedString>
getType()
-
Field Details
-
INSTANCE
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceStringCacheTypeAdapter<CompressedString>
- Returns:
- The Class of the STRING_LIKE_TYPE instances created by this adapter.
-
empty
- Specified by:
empty
in interfaceStringCacheTypeAdapter<CompressedString>
- Returns:
- The implementation-appropriate empty STRING_LIKE_TYPE instance.
-
create
Description copied from interface:StringCacheTypeAdapter
Note: StringCache implementations may choose not hold a lock while invoking this method.- Specified by:
create
in interfaceStringCacheTypeAdapter<CompressedString>
- Parameters:
string
- The input String- Returns:
- A newly allocated STRING_LIKE_TYPE with the same content as string.
-
create
@NotNull public final @NotNull CompressedString create(@NotNull @NotNull StringCompatible protoString) Description copied from interface:StringCacheTypeAdapter
Note: StringCache implementations may choose not hold a lock while invoking this method.- Specified by:
create
in interfaceStringCacheTypeAdapter<CompressedString>
- Parameters:
protoString
- The input StringCompatible- Returns:
- A newly allocated STRING_LIKE_TYPE with the same content as protoString.
-
areEqual
public final boolean areEqual(@NotNull @NotNull CharSequence key, @NotNull @NotNull CompressedString value) Description copied from interface:StringCacheTypeAdapter
Compare key (Assumed to be a String *or* a StringCompatible) with value (created by this factory).- Specified by:
areEqual
in interfaceStringCacheTypeAdapter<CompressedString>
- Parameters:
key
- The keyvalue
- The value- Returns:
- True iff key and value are equal (according to StringCompatible's implementation).
-