Class C14nUtil

java.lang.Object
io.deephaven.engine.util.caching.C14nUtil

public class C14nUtil extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    An CanonicalizationCache instance that can/should be used by "general" utilities that want to store canonicalized objects in memory.
    static final boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    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
    Return a key that represents the values, canonicalizing all values and the result itself if canonicalization is enabled.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ENABLED

      public static final boolean ENABLED
    • CACHE

      public static final OpenAddressedCanonicalizationCache 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

      public static Object maybeMakeCompoundKey(Object... values)
      Return a key that represents the values, 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