Class PropertyName

java.lang.Object
io.smallrye.config.PropertyName

public class PropertyName extends Object
A configuration name.

While a configuration name is represented as a String, the equality rules are different, due to the use of star (*), to match a segment in the name. A segment is a part of the configuration name separated by a dot (.). For example:

  • foo.bar matches foo.*
  • foo.bar.baz matches foo.*.baz
  • foo."bar.baz" matches foo.*
  • foo.bar[0] matches foo.bar[*]
  • Constructor Details

    • PropertyName

      public PropertyName(String name)
  • Method Details

    • getName

      public String getName()
    • equals

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

      public static boolean equals(String name, String other)
      Compares both arguments using PropertyName equals semantics.
      Parameters:
      name - a String with a configuration name.
      other - a String with another configuration name.
      Returns:
      true if both arguments match the PropertyName semantics, false otherwise.
    • equals

      public static boolean equals(String name, int offset, int len, String other, int ooffset, int olen)
      Compares both arguments using PropertyName equals semantics for the specified regions.
      Parameters:
      name - a String with a configuration name.
      offset - the starting offset of the subregion in the String name.
      len - the number of characters to compare in the String name.
      other - a String with another configuration name.
      ooffset - the starting offset of the subregion in the String other.
      olen - the number of characters to compare in the String other.
      Returns:
      true if both arguments match the PropertyName semantics, false otherwise.
    • hashCode

      public int hashCode()
      Calculate the hash code for the configuration name.

      Due to the equality rules, the hash function is not suitable for use in structures that require an even distribution of keys.

      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • name

      public static PropertyName name(String name)
    • unprofiled

      public static PropertyName unprofiled(String name)