Class Canonicalizer<T>

java.lang.Object
org.apache.parquet.hadoop.metadata.Canonicalizer<T>
Type Parameters:
T - the type of values canonicalized by subclasses

public class Canonicalizer<T> extends Object
returns canonical representation of objects (similar to String.intern()) to save memory if a.equals(b) then canonicalize(a) == canonicalize(b) this class is thread safe
  • Constructor Details

    • Canonicalizer

      public Canonicalizer()
  • Method Details

    • canonicalize

      public final T canonicalize(T value)
      Parameters:
      value - the value to canonicalize
      Returns:
      the corresponding canonical value
    • toCanonical

      protected T toCanonical(T value)
      Parameters:
      value - the value to canonicalize if needed
      Returns:
      the canonicalized value