Class DiscoverySelectorIdentifier

java.lang.Object
org.junit.platform.engine.DiscoverySelectorIdentifier

@API(status=EXPERIMENTAL, since="1.11") public final class DiscoverySelectorIdentifier extends Object
Identifier for a DiscoverySelector with a specific prefix.

The string representation of an identifier is intended to be human-readable and is formatted as prefix:value.

Since:
1.11
See Also:
  • Method Details

    • create

      public static DiscoverySelectorIdentifier create(String prefix, String value)
      Create a new DiscoverySelectorIdentifier with the supplied prefix and value.
      Parameters:
      prefix - the prefix; never null or blank
      value - the value; never null or blank
    • parse

      public static DiscoverySelectorIdentifier parse(String string)
      Parse the supplied string representation of a DiscoverySelectorIdentifier in the format prefix:value.
      Parameters:
      string - the string representation of a DiscoverySelectorIdentifier
      Returns:
      the parsed DiscoverySelectorIdentifier
      Throws:
      PreconditionViolationException - if the supplied string does not conform to the expected format
    • getPrefix

      public String getPrefix()
      Get the prefix of this identifier.
      Returns:
      the prefix; never null or blank
    • getValue

      public String getValue()
      Get the value of this identifier.
      Returns:
      the value; never null or blank
    • equals

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

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

      public String toString()
      Get the string representation of this identifier in the format prefix:value.
      Overrides:
      toString in class Object