Package org.junit.platform.engine
Class DiscoverySelectorIdentifier
- java.lang.Object
-
- org.junit.platform.engine.DiscoverySelectorIdentifier
-
@API(status=MAINTAINED, since="1.13.3") public final class DiscoverySelectorIdentifier extends java.lang.ObjectIdentifier for aDiscoverySelectorwith 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:
DiscoverySelectors.parse(String),DiscoverySelectorIdentifierParser
-
-
Constructor Summary
Constructors Modifier Constructor Description privateDiscoverySelectorIdentifier(java.lang.String prefix, java.lang.String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DiscoverySelectorIdentifiercreate(java.lang.String prefix, java.lang.String value)Create a newDiscoverySelectorIdentifierwith the supplied prefix and value.booleanequals(java.lang.Object o)java.lang.StringgetPrefix()Get the prefix of this identifier.java.lang.StringgetValue()Get the value of this identifier.inthashCode()static DiscoverySelectorIdentifierparse(java.lang.String string)Parse the supplied string representation of aDiscoverySelectorIdentifierin the formatprefix:value.java.lang.StringtoString()Get the string representation of this identifier in the formatprefix:value.
-
-
-
Method Detail
-
create
public static DiscoverySelectorIdentifier create(java.lang.String prefix, java.lang.String value)
Create a newDiscoverySelectorIdentifierwith the supplied prefix and value.- Parameters:
prefix- the prefix; nevernullor blankvalue- the value; nevernullor blank
-
parse
public static DiscoverySelectorIdentifier parse(java.lang.String string)
Parse the supplied string representation of aDiscoverySelectorIdentifierin the formatprefix:value.- Parameters:
string- the string representation of aDiscoverySelectorIdentifier- Returns:
- the parsed
DiscoverySelectorIdentifier - Throws:
org.junit.platform.commons.PreconditionViolationException- if the supplied string does not conform to the expected format
-
getPrefix
public java.lang.String getPrefix()
Get the prefix of this identifier.- Returns:
- the prefix; never
nullor blank
-
getValue
public java.lang.String getValue()
Get the value of this identifier.- Returns:
- the value; never
nullor blank
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Get the string representation of this identifier in the formatprefix:value.- Overrides:
toStringin classjava.lang.Object
-
-