Class BinaryName
- java.lang.Object
-
- com.thomasjensen.checkstyle.addons.checks.BinaryName
-
@Immutable public final class BinaryName extends Object
Represents a Java binary class name for reference types, in the form of its fragments. This is the only way to tell the difference between a class calledA$Band a class calledAthat has an inner classB.
-
-
Constructor Summary
Constructors Constructor Description BinaryName(String pPkg, String pOuterCls, String... pInnerCls)Constructor.BinaryName(String pPkg, Collection<String> pClsNames)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object pOther)StringgetInnerSimpleName()Getter.StringgetOuterFqcn()The fully qualified name of the outer class.StringgetOuterSimpleName()Getter.StringgetPackage()inthashCode()StringtoString()
-
-
-
Constructor Detail
-
BinaryName
public BinaryName(@Nullable String pPkg, @Nonnull String pOuterCls, @Nullable String... pInnerCls)
Constructor.- Parameters:
pPkg- package namepOuterCls- outer class simple namepInnerCls- inner class simple names in descending order of their nesting
-
BinaryName
public BinaryName(@Nullable String pPkg, @Nonnull Collection<String> pClsNames)
Constructor.- Parameters:
pPkg- package namepClsNames- class simple names in descending order of their nesting
-
-
Method Detail
-
getPackage
public String getPackage()
-
getOuterSimpleName
public String getOuterSimpleName()
Getter.- Returns:
- the simple name of the outer class (even if this binary name represents an inner class)
-
getInnerSimpleName
public String getInnerSimpleName()
Getter.- Returns:
- the simple name of the inner class represented by this binary name.
nullif this binary name does not represent an inner class
-
getOuterFqcn
@CheckForNull public String getOuterFqcn()
The fully qualified name of the outer class.- Returns:
- that, or
nullif the simple name of the outer class is unknown
-
-