Package io.deephaven.base.string.cache
Interface StringCacheTypeAdapter<STRING_LIKE_TYPE extends CharSequence>
- All Known Implementing Classes:
StringCacheTypeAdapterCompressedStringImpl,StringCacheTypeAdapterMappedCompressedStringImpl,StringCacheTypeAdapterStringImpl
public interface StringCacheTypeAdapter<STRING_LIKE_TYPE extends CharSequence>
Abstracts type-specific functionality for use by StringCache implementations.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanareEqual(@NotNull CharSequence key, STRING_LIKE_TYPE value) Compare key (Assumed to be a String *or* a StringCompatible) with value (created by this factory).create(@NotNull StringCompatible protoString) Note: StringCache implementations may choose not hold a lock while invoking this method.Note: StringCache implementations may choose not hold a lock while invoking this method.empty()@NotNull Class<STRING_LIKE_TYPE>getType()
-
Method Details
-
getType
- Returns:
- The Class of the STRING_LIKE_TYPE instances created by this adapter.
-
empty
- Returns:
- The implementation-appropriate empty STRING_LIKE_TYPE instance.
-
create
Note: StringCache implementations may choose not hold a lock while invoking this method.- Parameters:
string- The input String- Returns:
- A newly allocated STRING_LIKE_TYPE with the same content as string.
-
create
Note: StringCache implementations may choose not hold a lock while invoking this method.- Parameters:
protoString- The input StringCompatible- Returns:
- A newly allocated STRING_LIKE_TYPE with the same content as protoString.
-
areEqual
Compare key (Assumed to be a String *or* a StringCompatible) with value (created by this factory).- Parameters:
key- The keyvalue- The value- Returns:
- True iff key and value are equal (according to StringCompatible's implementation).
-