Package io.deephaven.engine.util.caching
Class C14nUtil
java.lang.Object
io.deephaven.engine.util.caching.C14nUtil
-
Field Summary
Modifier and TypeFieldDescriptionstatic final OpenAddressedCanonicalizationCache
An CanonicalizationCache instance that can/should be used by "general" utilities that want to store canonicalized objects in memory.static final boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
maybeCanonicalize
(T item) Canonicalize an object using the default CanonicalizationCache, if it's an instance of a known appropriate class.static <T> boolean
maybeCanonicalizeAll
(@NotNull T[] items) Canonicalizes an array of objects in-place using the default CanonicalizationCache, if they're instances of known appropriate classes.static Object
maybeMakeCompoundKey
(Object... values) Return a key that represents thevalues
, canonicalizing all values and the result itself if canonicalization is enabled.
-
Field Details
-
ENABLED
public static final boolean ENABLED -
CACHE
An CanonicalizationCache instance that can/should be used by "general" utilities that want to store canonicalized objects in memory. Shared by StringUtils.
-
-
Constructor Details
-
C14nUtil
public C14nUtil()
-
-
Method Details
-
maybeCanonicalize
public static <T> T maybeCanonicalize(T item) Canonicalize an object using the default CanonicalizationCache, if it's an instance of a known appropriate class.- Type Parameters:
T
-- Parameters:
item
-- Returns:
- null if item was null, else the canonicalized version of item if its class was eligible, else item
-
maybeCanonicalizeAll
public static <T> boolean maybeCanonicalizeAll(@NotNull @NotNull T[] items) Canonicalizes an array of objects in-place using the default CanonicalizationCache, if they're instances of known appropriate classes. May canonicalize some items without canonicalizing all.- Parameters:
items
-- Returns:
- true if all non-null items were canonicalized, else false.
-
maybeMakeCompoundKey
Return a key that represents thevalues
, canonicalizing all values and the result itself if canonicalization is enabled.- Parameters:
values
- the value or values to turn into a key- Returns:
- an opaque, potentially-canonicalized key for use in a map
-