Class NameSet


public class NameSet extends Object
Set of names that can be accessed with and without case sensitivity.
  • Field Details

  • Constructor Details

    • NameSet

      public NameSet()
      Creates a NameSet, initially empty.
  • Method Details

    • immutableCopyOf

      public static NameSet immutableCopyOf(Set<String> names)
      Creates a NameSet that is an immutable copy of a given collection.
    • toString

      public String toString()
      toString in class Object
    • hashCode

      public int hashCode()
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      equals in class Object
    • add

      public void add(String name)
    • range

      public Collection<String> range(String name, boolean caseSensitive)
      Returns an iterable over all the entries in the set that match the given name. If case-sensitive, that iterable will have 0 or 1 elements; if case-insensitive, it may have 0 or more.
    • contains

      public boolean contains(String name, boolean caseSensitive)
      Returns whether this set contains the given name, with a given case-sensitivity.
    • iterable

      public Iterable<String> iterable()
      Returns the contents as an iterable.