Class UniqueIdSelector
- java.lang.Object
-
- org.junit.platform.engine.discovery.UniqueIdSelector
-
- All Implemented Interfaces:
DiscoverySelector
@API(status=STABLE, since="1.0") public class UniqueIdSelector extends java.lang.Object implements DiscoverySelectorADiscoverySelectorthat selects aUniqueIdso thatTestEnginescan discover tests or containers based on unique IDs.- Since:
- 1.0
- See Also:
DiscoverySelectors.selectUniqueId(String),DiscoverySelectors.selectUniqueId(UniqueId)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUniqueIdSelector.IdentifierParser
-
Constructor Summary
Constructors Constructor Description UniqueIdSelector(UniqueId uniqueId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)UniqueIdgetUniqueId()Get the selectedUniqueId.inthashCode()java.util.Optional<DiscoverySelectorIdentifier>toIdentifier()Return the identifier of this selector.java.lang.StringtoString()
-
-
-
Field Detail
-
uniqueId
private final UniqueId uniqueId
-
-
Constructor Detail
-
UniqueIdSelector
UniqueIdSelector(UniqueId uniqueId)
-
-
Method Detail
-
equals
@API(status=STABLE, since="1.3") public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object- Since:
- 1.3
-
hashCode
@API(status=STABLE, since="1.3") public int hashCode()- Overrides:
hashCodein classjava.lang.Object- Since:
- 1.3
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toIdentifier
public java.util.Optional<DiscoverySelectorIdentifier> toIdentifier()
Description copied from interface:DiscoverySelectorReturn the identifier of this selector.The returned identifier must be parsable by a corresponding
DiscoverySelectorIdentifierParser.The default implementation returns
Optional.empty(). Can be overridden by concrete implementations.- Specified by:
toIdentifierin interfaceDiscoverySelector- Returns:
- an
Optionalcontaining the identifier of this selector; nevernullbut potentially empty if the selector does not support identifiers
-
-