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$B
and a class calledA
that 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 boolean
equals(Object pOther)
String
getInnerSimpleName()
Getter.String
getOuterFqcn()
The fully qualified name of the outer class.String
getOuterSimpleName()
Getter.String
getPackage()
int
hashCode()
String
toString()
-
-
-
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.
null
if 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
null
if the simple name of the outer class is unknown
-
-