- All Known Implementing Classes:
PackageDescImpl
A nominal descriptor for a
Package constant.
To create a PackageDesc for a package, use of(java.lang.String) or
ofInternalName(String).
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCompare the specified object with this descriptor for equality.static PackageDescReturns a PackageDesc for a package, given the name of the package, such as"java.lang".static PackageDescofInternalName(String name) Returns a PackageDesc for a package, given the name of the package in internal form, such as"java/lang".Returns the fully qualified (slash-separated) internal package name of this PackageDesc.default StringReturns the fully qualified (dot-separated) binary package name of this PackageDesc.
-
Method Details
-
of
- Parameters:
name- the fully qualified (dot-separated) binary package name- Returns:
- a PackageDesc describing the desired package
- Throws:
NullPointerException- if the argument isnullIllegalArgumentException- if the name string is not in the correct format
-
ofInternalName
Returns a PackageDesc for a package, given the name of the package in internal form, such as"java/lang".In this internal form, the ASCII periods (.) that normally separate the identifiers which make up the binary name are replaced by ASCII forward slashes (/).
- Parameters:
name- the fully qualified class name, in internal (slash-separated) form- Returns:
- a PackageDesc describing the desired package
- Throws:
NullPointerException- if the argument isnullIllegalArgumentException- if the name string is not in the correct format
-
packageInternalName
String packageInternalName()Returns the fully qualified (slash-separated) internal package name of this PackageDesc.- Returns:
- the package name, or the empty string for the default package
-
packageName
Returns the fully qualified (dot-separated) binary package name of this PackageDesc.- Returns:
- the package name, or the empty string for the default package
-
equals
Compare the specified object with this descriptor for equality. Returnstrueif and only if the specified object is also a PackageDesc and both describe the same package.
-