The class holds a canonicalized name of a bundle in the Nest repository. A bundle identifier consists of all lower-case parts which are the following:
- Name: The name of the bundle. It contains one or more alphabetical (
a-z
), numeric (0-9
), underscore (_
) or dot (.
) characters. In general, it should be in thesome.bundle.name
format, similar to Java package naming. - Qualifiers: Bundle qualifiers are arbitrary attributes attached to the bundle name. Qualifiers can contain the same characters as the name. They can be used to differentiate different bundles under the same enclosing bundle name.
- Meta-qualifiers: Same as bundle qualifiers, but they are specially handled by the implementation.
Currently the following bundle qualifiers are recognized:
- Bundle version: Version meta-qualifiers are in the format of
v<num>[.<num>]*
. They are used to distinguish different versions of the same bundles. It is ensured that a bundle identifier may contain either none, or at most one version qualifier.
For more information about version numbers, see compareVersionNumbers(String, String) .
- Bundle version: Version meta-qualifiers are in the format of
-
) separated form when normalized:
some.bundle.name-q1-q2-v1.0When a bundle identifer is constructed, its parts will be normalized, meaning that the order of qualifiers and meta qualifiers will not be kept, and they will be stored in alphabetical order. Duplicate qualifiers will be removed. This means that the following bundle identifiers are considered to be equal:
some.bundle.name-q1-q2-v1.0 some.bundle.name-q2-q1-v1.0 some.bundle.name-q1-v1.0-q2-q1 SOME.BuNdLe.name-Q1-q2-V1.0-q1When bundle identifiers are converted back to string representation, they will have the following format:
name[-qualifiers]*[-metaqualifiers]*If there are not qualifiers, or no meta qualifiers, the separating dash character will be omitted.
public | For Externalizable. |
public int | Compares this object with the specified object for order. |
public static int | Compares two version numbers in ascending order. |
public static int | Comparator function for two version qualifiers. |
public boolean | Indicates whether some other object is "equal to" this one. |
public NavigableSet< | Gets all qualifiers in this bundle identifier. |
public NavigableSet< | Gets the qualifier part of the bundle identifier. |
public NavigableSet< | Gets the meta-qualifier part of the bundle identifier. |
public String | getName() Gets the name part of the bundle identifier. |
public String | Gets the version number in this bundle identifier if any. |
public static int | getVersionNumberComponentCount( Counts the number compontents in the argument version number. |
public String | Gets the version qualifier in this bundle identifier if any. |
public static < | getVersionQualifier( Utility function to retrieve the version qualifier from the argument qualifiers. |
public static String | getVersionQualifierVersionNumberPart( Gets the version number part of a version qualifier argument. |
public boolean | Checks if this bundle identifier has any normal or meta qualifiers. |
public boolean | Checks if this bundle identifier has any meta qualifiers. |
public boolean | Checks if this bundle identifier has any normal qualifiers. |
public static boolean | hasVersionQualifier( Utility function to check if the argument contains any valid version qualifiers. |
public int | hashCode() Returns a hash code value for the object. |
public static boolean | isMetaQualifier( Checks if the argument is a valid version qualifier recognized by this class. |
public static boolean | isValidBundleIdentifier( Checks if the argument has a valid bundle identifier format. |
public static boolean | isValidBundleName( Checks if the argument is a valid bundle name. |
public static boolean | isValidVersionNumber( Checks if the argument string represents a valid version number. |
public static boolean | isValidVersionQualifier( Checks if the argument has a valid version qualifier format. |
public static String | makeVersionQualifier( Creates a new version qualifier. |
public static String | nextVersionNumberInNaturalOrder( Gets the strictly next version number that will compare to be greater than the argument. |
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() Returns a string representation of the object. |
public static BundleIdentifier | Converts the argument to a BundleIdentifier. |
public BundleIdentifier | Gets a bundle identifier derived from this that doesn't contain any normal or meta
qualifiers. |
public BundleIdentifier | Gets a bundle identifier derived from this that doesn't contain any meta qualifiers. |
public BundleIdentifier | Gets a bundle identifier derived from this that doesn't contain any (normal) 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 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.
Version numbers consist of one or more dot (.
) separated numbers. Each consecutive number component
in the version number have less significance than the preceeding one. This method compares them by comparing each
number component in ascending order. Shorter version numbers are ordered first.
The first recognized version number is simply 0
. The following version number examples are in
strictly ascending order:
0 0.0 0.1 0.1.0 0.9 0.10 0.10.0 0.11 1.0 1.1 1.1.0 1.2 1.2.3.4.5 1.2.4 2.0 3 3.0 3.1 4 4.1Any succeeding
.0
number parts are still considered to be part of the version number, and they are
not to be emitted. Any version number appended with the string ".0"
is considered to be strictly the
next in order. (See nextVersionNumberInNaturalOrder(null
.
This method compares the numbers in the argument version qualifiers using the rules specified by
compareVersionNumbers(
The arguments are expected to be version numbers preceeded by a single 'v'
or 'V'
character.
null
.
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.Meta-qualfiers and normal qualifiers both included.
This method is the same as constructing a new set that includes both getBundleQualifiers() and getMetaQualifiers().
null
.Meta-qualifiers are not included.
null
.null
.
This method gets the version qualifier, and strips the preceeding 'v'
from it.
null
if not present.This method will count the number segments in the argument version number. It is expected that the argument is already a valid version number, and this method will not verify its format.
E.g.:
1
: 1 component1.0
: 2 components3.0.5.0
: 4 components1.invalid.5.format
: 4 components (even though invalid format)
.
) occurrences in the argument.null
.
The returned string contains the preceeding 'v'
in it. Use getVersionNumber() to
automatically strip it.
null
if not present.
If the argument is null
, or multiple possible version qualifiers are found, null
is
returned.
This method will return the version number from a valid version qualifier. It will not check the argument if it is actually a valid version qualifier.
The method effectively removes the preceeding 'v'
character in the version qualifier.
null
.This method is the same as the following:
!hasNormalQualifiers() && !hasMetaQualifiers()
true
if there are any qualifiers present.true
if there are any meta qualifiers present.This check doesn't include the meta qualifiers.
true
if there are any normal qualifiers present.true
if the argument is non-null
, and at least one element is recognized to be
a valid version qualifier defined by this class.
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.)
Currently only version qualifiers are considered to be meta-qualifiers.
true
if the argument is a valid meta-qualifier.
If this method returns true
, valueOf(
This method doesn't semantically check the qualifier consistency, only the bundle identifier format.
true
if it has a valid bundle identifier format.The argument should only contain the name part of a bundle identifier. If it contains any qualifiers, the method will return false.
true
if the argument is a valid bundle name.
Valid version numbers are one or more dot (.
) separated non-negative numbers. E.g.:
0 1 0.1 1.0 1.0.0 1.2.3
true
if the argument is non-null
and has a valid version number format.
Version qualifiers consist of a preceeding 'v'
character and a version number. See
isValidVersionNumber(
true
if the argument is non-null
and has a valid version qualifier format.
This method simply prepends the argument with "v"
. The method doesn't check if the argument is a
valid version number.
null
.
The following will be true for any valid version number argument v
and created next version number
n
:
compareVersionNumbers(v, n) < 0
There exists no version number x
that is greater than v
and less than n
.
This method will not check if the argument is already a valid version number.
null
.toString
method returns a string that
"textually represents" this object. The result should be a concise but informative representation that is easy
for a person to read. It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of
which the object is an instance, the at-sign character `@
', and the unsigned hexadecimal representation
of the hash code of the object. In other words, this method returns a string equal to the value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
The input is expected to start with the bundle name, and have any qualifiers appended with separating dash
('-'
) characters:
[bundle.name][-qualifier]*The input will be converted to a lower-case representation as required by this class.
null
.this
that doesn't contain any normal or meta
qualifiers.
If this bundle identifier already has no normal or meta qualifiers, this
is returned.
this
.this
that doesn't contain any meta qualifiers.
If this bundle identifier already has no meta-qualifiers, this
is returned.
this
, but without any
meta-qualifiers.this
that doesn't contain any (normal) qualifiers.
If this bundle identifier already has no (normal) qualifiers, this
is returned.
this
, but without any (normal)
qualifiers.