@Beta @NonNullByDefault public abstract class JavaTypeName extends Object implements org.opendaylight.yangtools.concepts.Identifier, org.opendaylight.yangtools.concepts.Immutable
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canCreateEnclosed(String simpleName)
Check if an enclosed type with specified name can be created.
|
static JavaTypeName |
create(Class<?> clazz)
Create a TypeName for an existing class.
|
static JavaTypeName |
create(String packageName,
String simpleName)
Create a TypeName for a top-level class.
|
abstract JavaTypeName |
createEnclosed(String simpleName)
Create a TypeName for a class immediately enclosed by this class.
|
abstract JavaTypeName |
createSibling(String simpleName)
Create a TypeName for a class that is a sibling of this class.
|
boolean |
equals(@Nullable Object obj) |
int |
hashCode() |
abstract Optional<JavaTypeName> |
immediatelyEnclosingClass()
Return the enclosing class JavaTypeName, if present.
|
abstract String |
localName()
Return the package-local name by which this type can be referenced by classes living in the same package.
|
abstract List<String> |
localNameComponents()
Return broken-down package-local name components.
|
abstract String |
packageName()
Return the package name in which this class resides.
|
String |
simpleName()
Return the simple name of the class.
|
abstract JavaTypeName |
topLevelClass()
Return the top-level class JavaTypeName which is containing this type, or self if this type is a top-level
one.
|
abstract String |
toString()
Return the Fully-Qualified Class Name string of this TypeName.
|
public static JavaTypeName create(Class<?> clazz)
clazz
- Class instanceNullPointerException
- if clazz is nullpublic static JavaTypeName create(String packageName, String simpleName)
packageName
- Class package namesimpleName
- Class simple nameNullPointerException
- if any of the arguments is nullIllegalArgumentException
- if any of the arguments is emptypublic abstract boolean canCreateEnclosed(String simpleName)
simpleName
- Simple name of the enclosed classIllegalArgumentException
- if the simpleName is emptyUnsupportedOperationException
- if this type name does not support nested typepublic abstract JavaTypeName createEnclosed(String simpleName)
simpleName
- Simple name of the enclosed classNullPointerException
- if simpleName is nullIllegalArgumentException
- if the simpleName hides any of the enclosing types or if it is emptyUnsupportedOperationException
- if this type name does not support nested typepublic abstract JavaTypeName createSibling(String simpleName)
simpleName
- Simple name of the sibling classNullPointerException
- if simpleName is nullIllegalArgumentException
- if the simpleName is emptypublic final String simpleName()
public abstract String packageName()
public abstract Optional<JavaTypeName> immediatelyEnclosingClass()
public abstract JavaTypeName topLevelClass()
public abstract String localName()
public abstract List<String> localNameComponents()
public final int hashCode()
public final boolean equals(@Nullable Object obj)
Copyright © 2019 OpenDaylight. All rights reserved.