Class QualifiedName
java.lang.Object
org.inferred.freebuilder.processor.source.ValueType
org.inferred.freebuilder.processor.source.QualifiedName
- All Implemented Interfaces:
Comparable<QualifiedName>
The qualified name of a type. Lets us pass a type to a
without a Class or
javax.lang.model reference.
invalid reference
TypeShortener
-
Nested Class Summary
Nested classes/interfaces inherited from class org.inferred.freebuilder.processor.source.ValueType
ValueType.FieldReceiver -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateQualifiedName(String packageName, com.google.common.collect.ImmutableList<String> simpleNames) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFields(ValueType.FieldReceiver fields) Implement this method to report the name and value of each field.intReturns theQualifiedNameof the type enclosing this one.com.google.common.collect.ImmutableList<String> booleanisNestedIn(QualifiedName other) booleannestedType(String simpleName) Returns theQualifiedNameof a type calledsimpleNamenested in this one.static QualifiedNameReturns aQualifiedNameforcls, unshading if necessary.static QualifiedNameReturns aQualifiedNamefor a type inpackageName.static QualifiedNameof(TypeElement type) Returns aQualifiedNamefortype.toString()Returns this qualified name as a string.withParameters(Iterable<? extends TypeParameterElement> typeParameters) withParameters(TypeParameterElement... parameters) withParameters(TypeMirror first, TypeMirror... rest)
-
Field Details
-
packageName
-
simpleNames
-
-
Constructor Details
-
QualifiedName
-
-
Method Details
-
of
Returns aQualifiedNamefor a type inpackageName. IfnestedTypesis empty, it is a top level type calledtopLevelType; otherwise, it is nested in that type. -
of
Returns aQualifiedNameforcls, unshading if necessary. -
of
Returns aQualifiedNamefortype. -
toString
Returns this qualified name as a string.Returns the same as
Class.getName()andTypeElement.getQualifiedName()would for the same type, e.g. "java.lang.Integer" or "com.example.OuterType.InnerType". -
getPackage
-
enclosingType
Returns theQualifiedNameof the type enclosing this one.- Throws:
IllegalStateException- ifisTopLevel()returns true
-
getSimpleNames
-
getSimpleName
-
isTopLevel
public boolean isTopLevel() -
isNestedIn
-
nestedType
Returns theQualifiedNameof a type calledsimpleNamenested in this one. -
withParameters
-
withParameters
-
withParameters
-
compareTo
- Specified by:
compareToin interfaceComparable<QualifiedName>
-
addFields
Description copied from class:ValueTypeImplement this method to report the name and value of each field.
-