Class StoreName

java.lang.Object
com.linkedin.venice.meta.StoreName

public class StoreName extends Object
This class is a handle to refer to a store. It intentionally does not contain any operational state related to the referenced store. It is appropriate to use as a map key. Its equals(Object) and hashCode() delegate to the same functions on the String form of the store name. The purpose of using this handle class rather than a String is two-fold: - It is a stronger type than String, since a String can contain anything. - It can be more performant, since shared instances are allocated once and reused thus causing less garbage, and shared instances are also faster to use as map keys (the hash code gets cached, and equality checks can be resolved by identity, in the common case).
  • Method Details

    • isValidStoreName

      public static boolean isValidStoreName(String name)
      Store name rules: 1. Only letters, numbers, underscore or dash 2. No double dashes
    • getName

      @Nonnull public String getName()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object