public static class AutoValueProcessor.Property
extends java.lang.Object
@AutoValue
class, defined by one of its abstract methods.
An instance of this class is made available to the Velocity template engine for
each property. The public methods of this class define JavaBeans-style properties
that are accessible from templates. For example getType()
means we can
write $p.type
for a Velocity variable $p
that is a Property
.Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableList<java.lang.String> |
annotations |
private java.lang.String |
identifier |
private javax.lang.model.element.ExecutableElement |
method |
private java.lang.String |
name |
private java.lang.String |
nullableAnnotation |
private java.lang.String |
type |
Constructor and Description |
---|
Property(java.lang.String name,
java.lang.String identifier,
javax.lang.model.element.ExecutableElement method,
java.lang.String type,
TypeSimplifier typeSimplifier) |
Modifier and Type | Method and Description |
---|---|
private com.google.common.collect.ImmutableList<java.lang.String> |
buildAnnotations(TypeSimplifier typeSimplifier) |
private java.lang.String |
buildNullableAnnotation(TypeSimplifier typeSimplifier) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAccess() |
java.util.List<java.lang.String> |
getAnnotations() |
java.lang.String |
getGetter()
Returns the name of the getter method for this property as defined by the
@AutoValue
class. |
javax.lang.model.type.TypeKind |
getKind() |
java.lang.String |
getName()
Returns the name of the property as it should be used in strings visible to users.
|
java.lang.String |
getNullableAnnotation() |
(package private) javax.lang.model.element.TypeElement |
getOwner() |
java.lang.String |
getType() |
javax.lang.model.type.TypeMirror |
getTypeMirror() |
int |
hashCode() |
boolean |
isNullable() |
java.lang.String |
toString()
Returns the name of the property as it should be used when declaring identifiers (fields and
parameters).
|
private final java.lang.String name
private final java.lang.String identifier
private final javax.lang.model.element.ExecutableElement method
private final java.lang.String type
private final com.google.common.collect.ImmutableList<java.lang.String> annotations
private final java.lang.String nullableAnnotation
Property(java.lang.String name, java.lang.String identifier, javax.lang.model.element.ExecutableElement method, java.lang.String type, TypeSimplifier typeSimplifier)
private java.lang.String buildNullableAnnotation(TypeSimplifier typeSimplifier)
private com.google.common.collect.ImmutableList<java.lang.String> buildAnnotations(TypeSimplifier typeSimplifier)
public java.lang.String toString()
foo()
then this will be foo
.
If it was getFoo()
then it will be foo
. If it was getPackage()
then
it will be something like package0
, since package
is a reserved word.toString
in class java.lang.Object
public java.lang.String getName()
toString()
, except that if we had to use an identifier like
"package0" because "package" is a reserved word, the name here will be the original
"package".public java.lang.String getGetter()
@AutoValue
class. For property foo
, this will be foo
or getFoo
or isFoo
.javax.lang.model.element.TypeElement getOwner()
public javax.lang.model.type.TypeMirror getTypeMirror()
public java.lang.String getType()
public javax.lang.model.type.TypeKind getKind()
public java.util.List<java.lang.String> getAnnotations()
public boolean isNullable()
public java.lang.String getNullableAnnotation()
public java.lang.String getAccess()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object