A task name consists of a lowercase name string and arbitrary amount of lowercase qualifiers.
Name parts are in the format matching the following regular expression:
[a-z_0-9]+(\.[a-z_0-9]+)*With plain words: A dot separated non-empty parts consisting of lowercase latin ABC characters, numbers or underscore. Qualifiers parts are in the format matching the following regular expression:
[a-z0-9_.]+With plain words: A non-empty string consisting of lowercase latin ABC characters, numbers, underscore or dot.
Qualifiers are stored in a sorted manner ordered by their natural order. Task names are comparable.
Each task name have an unique string representation in the following format:
task.name[-qualifier]*Examples:
simple.task.name task.with.qualifier-q1 multi.qualifiers-q1-q2-q3
public static final Pattern | A regular expression for matching valid task name representations. |
public | TaskName() For Externalizable. |
public int | Compares this task name to the parameter. |
public boolean | Check if this task name equals the parameter. |
public String | getName() Gets the name for this task name. |
public static < | getTaskNameSubMap( Gets a submap for the argument that contains only the entries that have the same name as
the parameter task name. |
public NavigableSet< | Gets the qualifiers of this task name. |
public boolean | Checks if the task name has any qualifiers defined for it. |
public int | hashCode() Returns a hash code value for the object. |
public static boolean | isValidQualifier( Checks if the argument string is a valid qualifier for a task name. |
public void | The object implements the readExternal method to restore its
contents by calling the methods of DataInput for primitive
types and readObject for objects, strings and arrays. |
public String | toString() Converts this task name to a string representation. |
public static TaskName | Converts the parameter string to a task name. |
public static TaskName | valueOf( Converts the parameters to a task name. |
public static TaskName | Converts the parameters to a task name. |
public TaskName | Gets a task name that has the same name as this, but has no
qualifiers. |
public void | The object implements the writeExternal method to save its contents
by calling the methods of DataOutput for its primitive values or
calling the writeObject method of ObjectOutput for objects, strings,
and arrays. |
The name part is checked in a case-insensitive manner.
Task names are ordered by name first, then each qualifier is compared to the corresponding parameter qualifiers at the same position.
Compares this object with the specified object for order.Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)
The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.
Finally, the implementor must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.
It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."
In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.
Two task names equal if they have the same name and have the same qualifiers.
This method only returns true
if compareTo(
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
The equals
method for class Object
implements the most discriminating possible equivalence
relation on objects; that is, for any non-null reference values x
and y
, this method returns
true
if and only if x
and y
refer to the same object (x == y
has the value
true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden,
so as to maintain the general contract for the hashCode
method, which states that equal objects must have
equal hash codes.
true
if this object is the same as the obj argument; false
otherwise.true
if there are at least one qualifier.
The general contract of hashCode
is:
- Whenever it is invoked on the same object more than once during an execution of a Java application, the
hashCode
method must consistently return the same integer, provided no information used inequals
comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equals(Object)
method, then calling thehashCode
method on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal according to the
Object.equals(
Object) method, then calling thehashCode
method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by class Object
does return distinct
integers for distinct objects. (This is typically implemented by converting the internal address of the object
into an integer, but this implementation technique is not required by the Java™ programming language.)
true
if the qualifier has a valid format described by this class.
The return value passed to valueOf(this
.
See TaskName documentation for the resulting format.
See TaskName documentation for the expected format. The input will be converted to lowercase.
Multiple consecutive '-'
will be collapsed, empty qualifiers will not be included.
null
.The input will be converted to lowercase.
The parameters are checked if they match the expected format.
null
.The input will be converted to lowercase.
The parameters are checked if they match the expected format.
If this task name already has no qualifiers, it is simply returned.