Class Entry
- java.lang.Object
-
- org.codehaus.plexus.classworlds.realm.Entry
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.ClassLoaderclassLoader(package private) java.lang.StringpkgName
-
Constructor Summary
Constructors Constructor Description Entry(java.lang.ClassLoader realm, java.lang.String pkgName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Entry that)Compare this entry to another for relative ordering.booleanequals(java.lang.Object thatObj)Test this entry for equality to another.(package private) java.lang.ClassLoadergetClassLoader()Retrieve the class loader.(package private) java.lang.StringgetPackageName()Retrieve the package name.inthashCode()Consistent withequals(java.lang.Object), this method creates a hashCode based on the packagename.(package private) booleanmatches(java.lang.String name)Determine if the class/resource name matches the package described by this entry.java.lang.StringtoString()
-
-
-
Method Detail
-
getClassLoader
java.lang.ClassLoader getClassLoader()
Retrieve the class loader.- Returns:
- The class loader.
-
getPackageName
java.lang.String getPackageName()
Retrieve the package name.- Returns:
- The package name.
-
matches
boolean matches(java.lang.String name)
Determine if the class/resource name matches the package described by this entry.- Parameters:
name- The class or resource name to test, must not benull.- Returns:
trueif this entry matches the classname, otherwisefalse.
-
compareTo
public int compareTo(Entry that)
Compare this entry to another for relative ordering. The natural ordering of Entry objects is reverse-alphabetical based upon package name.- Specified by:
compareToin interfacejava.lang.Comparable<Entry>- Parameters:
thatObj- The object to compare.- Returns:
- -1 if this object sorts before that object, 0 if they are equal, or 1 if this object sorts after that object.
-
equals
public boolean equals(java.lang.Object thatObj)
Test this entry for equality to another. Consistent withcompareTo(org.codehaus.plexus.classworlds.realm.Entry), this method tests for equality purely on the package name.- Overrides:
equalsin classjava.lang.Object- Parameters:
thatObj- The object to compare- Returns:
trueif the two objects are semantically equivalent, otherwisefalse.
-
hashCode
public int hashCode()
Consistent withequals(java.lang.Object), this method creates a hashCode based on the packagename.- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-