public static class AutoValueProcessor.Property extends 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 | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getAccess() |
List<String> |
getAnnotations() |
String |
getGetter()
Returns the name of the getter method for this property as defined by the
@AutoValue
class. |
TypeKind |
getKind() |
String |
getName()
Returns the name of the property as it should be used in strings visible to users.
|
String |
getNullableAnnotation()
Returns the string to use as an annotation to indicate the nullability of this property.
|
Optionalish |
getOptional()
Returns an
Optionalish representing the kind of Optional that this property's type
is, or null if the type is not an Optional of any kind. |
String |
getType() |
TypeMirror |
getTypeMirror() |
int |
hashCode() |
boolean |
isNullable() |
String |
toString()
Returns the name of the property as it should be used when declaring identifiers (fields and
parameters).
|
public 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.public 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 String getGetter()
@AutoValue
class. For property foo
, this will be foo
or getFoo
or isFoo
.public TypeMirror getTypeMirror()
public String getType()
public TypeKind getKind()
public Optionalish getOptional()
Optionalish
representing the kind of Optional that this property's type
is, or null if the type is not an Optional of any kind.public String getNullableAnnotation()
"@Nullable "
or "@javax.annotation.Nullable "
.public boolean isNullable()
public String getAccess()
Copyright © 2021. All rights reserved.