public class QualifiedName extends ValueType
TypeShortener without a Class or
javax.lang.model reference.ValueType.FieldReceiver| Modifier and Type | Method and Description |
|---|---|
protected void |
addFields(ValueType.FieldReceiver fields)
Implement this method to report the name and value of each field.
|
QualifiedName |
getEnclosingType()
Returns the
QualifiedName of the type enclosing this one. |
String |
getPackage() |
String |
getSimpleName() |
com.google.common.collect.ImmutableList<String> |
getSimpleNames() |
boolean |
isTopLevel() |
QualifiedName |
nestedType(String simpleName)
Returns the
QualifiedName of a type called simpleName nested in this one. |
static QualifiedName |
of(Class<?> cls)
Returns a
QualifiedName for cls. |
static QualifiedName |
of(String packageName,
String topLevelType,
String... nestedTypes)
Returns a
QualifiedName for a type in packageName. |
static QualifiedName |
of(TypeElement type)
Returns a
QualifiedName for type. |
String |
toString()
Returns this qualified name as a string.
|
ParameterizedType |
withParameters(Iterable<? extends TypeParameterElement> typeParameters) |
ParameterizedType |
withParameters(String... typeParameters) |
public static QualifiedName of(String packageName, String topLevelType, String... nestedTypes)
QualifiedName for a type in packageName. If nestedTypes is
empty, it is a top level type called topLevelType; otherwise, it is nested in that
type.public static QualifiedName of(Class<?> cls)
QualifiedName for cls.public static QualifiedName of(TypeElement type)
QualifiedName for type.public String toString()
Returns the same as Class.getName() and TypeElement.getQualifiedName()
would for the same type, e.g. "java.lang.Integer" or "com.example.OuterType.InnerType".
public String getPackage()
public com.google.common.collect.ImmutableList<String> getSimpleNames()
public String getSimpleName()
public boolean isTopLevel()
public QualifiedName nestedType(String simpleName)
QualifiedName of a type called simpleName nested in this one.public ParameterizedType withParameters(String... typeParameters)
public ParameterizedType withParameters(Iterable<? extends TypeParameterElement> typeParameters)
public QualifiedName getEnclosingType()
QualifiedName of the type enclosing this one.IllegalStateException - if isTopLevel() returns trueprotected void addFields(ValueType.FieldReceiver fields)
ValueTypeCopyright © 2016 Google, Inc.. All rights reserved.