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 | Method and Description |
|---|---|
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()
Returns the string to use as a method 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. |
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).
|
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.Objectpublic 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.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 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 final java.lang.String getNullableAnnotation()
"@`javax.annotation.Nullable` ",
where the `` is the encoding used by TypeEncoder.
If the property is nullable by virtue of its type rather than its method being
@Nullable, this method returns the empty string, because the @Nullable will
appear when the type is spelled out.public boolean isNullable()
public java.lang.String getAccess()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2017 Google, Inc.. All Rights Reserved.