Class Ztrings

All Implemented Interfaces:
Serializable, Cloneable, Iterable<String>, Collection<String>, Set<String>

public class Ztrings
extends ZHashSet<String>
Extension of ZHashSet<String> with some utility methods.
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • asCollection

      public Collection<String> asCollection()
      Casts the object to a generic collection of strings.
      Returns:
      the object as a generic collection of strings.
    • fromList

      public static Ztrings fromList​(Collection<String> c)
      Returns a new set that contains the elements of the given collection.
      Parameters:
      c - the given collection.
      Returns:
      a new set that contains the elements of the given collection.
    • concatenate

      public String concatenate​(String delimiter)
      Returns all set elements concatenated by the given delimiter into one string.
      Parameters:
      delimiter - the delimiter to use for concatenation.
      Returns:
      all set elements concatenated by the given delimiter into one string.
    • concatenate

      public String concatenate()
      Returns all set elements concatenated by a semicolon (;) into one string.
      Returns:
      all set elements concatenated by a semicolon (;) into one string.
    • split

      public static Ztrings split​(String string, String delimiter)
      Returns a new set containing the components of the given string after being split by the given delimiter.
      Parameters:
      string - the string to split.
      delimiter - the delimiter to use from splitting.
      Returns:
      a new set containing the components of the given string after being split by the given delimiter.
    • split

      public static Ztrings split​(String string)
      Returns a new set containing the components of the given string after being split by a semicolon (;).
      Parameters:
      string - the string to split.
      Returns:
      a new set containing the components of the given string after being split by a semicolon (;).
    • union

      public Ztrings union​(Collection<String> c)
      Returns a new set containing all elements of both this set and the given collection.
      Overrides:
      union in class ZHashSet<String>
      Parameters:
      c - the collection to unite with this set.
      Returns:
      a new set containing all elements of both this set and the given collection.
    • intersection

      public Ztrings intersection​(Collection<String> c)
      Returns a new set containing the elements that are contained in both this set and the given collection.
      Overrides:
      intersection in class ZHashSet<String>
      Parameters:
      c - the collection to intersect with this set.
      Returns:
      a new set containing the elements that are contained in both this set and the given collection.
    • toUUIDs

      public ZHashSet<UUID> toUUIDs()
      Converts a set of strings to a set of UUID elements.
      Returns:
      all the elements of this set as a set of UUID elements.