@API(status=STABLE,
since="1.0")
public final class TestTag
extends java.lang.Object
implements java.io.Serializable
isValid(String)
,
create(String)
,
Serialized FormModifier and Type | Field and Description |
---|---|
private java.lang.String |
name |
static java.util.Set<java.lang.String> |
RESERVED_CHARACTERS
Reserved characters that are not permissible as part of a tag name.
|
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
private |
TestTag(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
static TestTag |
create(java.lang.String name)
Create a
TestTag from the supplied name . |
private static boolean |
doesNotContainReservedCharacter(java.lang.String str) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getName()
Get the name of this tag.
|
int |
hashCode() |
static boolean |
isValid(java.lang.String name)
Determine if the supplied tag name is valid with regard to the supported
syntax for tags.
|
java.lang.String |
toString() |
private static final long serialVersionUID
private final java.lang.String name
public static final java.util.Set<java.lang.String> RESERVED_CHARACTERS
","
"("
")"
"&"
"|"
"!"
public static boolean isValid(java.lang.String name)
null
.If this method returns true
for a given name, it is then a
valid candidate for the create()
factory
method.
name
- the name of the tag to validate; may be null
or blanktrue
if the supplied tag name conforms to the supported
syntax for tagsStringUtils.isNotBlank(String)
,
String.trim()
,
StringUtils.doesNotContainWhitespace(String)
,
StringUtils.doesNotContainIsoControlCharacter(String)
,
RESERVED_CHARACTERS
,
create(String)
private static boolean doesNotContainReservedCharacter(java.lang.String str)
public static TestTag create(java.lang.String name) throws PreconditionViolationException
TestTag
from the supplied name
.
Consider checking whether the syntax of the supplied name
is valid before attempting to create a
TestTag
using this factory method.
Note: the supplied name
will be trimmed.
name
- the name of the tag; must be syntactically validPreconditionViolationException
- if the supplied tag name is not
syntactically validisValid(String)
public java.lang.String getName()
null
or blankpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object