public final class ClassName extends Object implements TypeName, Comparable<ClassName>
NestingKind.TOP_LEVEL and
NestingKind.MEMBER classes.| Modifier and Type | Class and Description |
|---|---|
static interface |
Writable.Context |
| Modifier and Type | Method and Description |
|---|---|
static ClassName |
bestGuessFromString(String classNameString)
Returns a new
ClassName instance for the given fully-qualified class name string. |
String |
canonicalName() |
String |
classFileName() |
int |
compareTo(ClassName o) |
static ClassName |
create(String packageName,
List<String> enclosingSimpleNames,
String simpleName) |
static ClassName |
create(String packageName,
String simpleName) |
com.google.common.base.Optional<ClassName> |
enclosingClassName() |
com.google.common.collect.ImmutableList<String> |
enclosingSimpleNames() |
boolean |
equals(Object obj) |
static ClassName |
fromClass(Class<?> clazz) |
static ClassName |
fromTypeElement(TypeElement element) |
int |
hashCode() |
ClassName |
nestedClassNamed(String memberClassName) |
String |
packageName() |
ClassName |
peerNamed(String peerClassName) |
Set<ClassName> |
referencedClasses() |
String |
simpleName() |
ClassName |
topLevelClassName() |
String |
toString() |
Appendable |
write(Appendable appendable,
Writable.Context context) |
public String packageName()
public com.google.common.collect.ImmutableList<String> enclosingSimpleNames()
public com.google.common.base.Optional<ClassName> enclosingClassName()
public String simpleName()
public String canonicalName()
public String classFileName()
public ClassName topLevelClassName()
public static ClassName fromTypeElement(TypeElement element)
public static ClassName bestGuessFromString(String classNameString)
ClassName instance for the given fully-qualified class name string. This
method assumes that the input is ASCII and follows typical Java style (lower-case package
names, upper-camel-case class names) and may produce incorrect results or throw
IllegalArgumentException otherwise. For that reason, fromClass(Class) and
fromClass(Class) should be preferred as they can correctly create ClassName
instances without such restrictions.public static ClassName create(String packageName, List<String> enclosingSimpleNames, String simpleName)
public Appendable write(Appendable appendable, Writable.Context context) throws IOException
IOExceptionpublic int compareTo(ClassName o)
compareTo in interface Comparable<ClassName>public Set<ClassName> referencedClasses()
referencedClasses in interface HasClassReferencesCopyright © 2015 Google, Inc.. All Rights Reserved.