Package com.google.auto.value.processor
Class AutoValueProcessor.Property
- java.lang.Object
-
- com.google.auto.value.processor.AutoValueProcessor.Property
-
- Enclosing class:
- AutoValueProcessor
public static class AutoValueProcessor.Property extends Object
A property of an@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 examplegetType()
means we can write$p.type
for a Velocity variable$p
that is aProperty
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 anOptionalish
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).
-
-
-
Method Detail
-
toString
public String toString()
Returns the name of the property as it should be used when declaring identifiers (fields and parameters). If the original getter method wasfoo()
then this will befoo
. If it wasgetFoo()
then it will befoo
. If it wasgetPackage()
then it will be something likepackage0
, sincepackage
is a reserved word.
-
getName
public String getName()
Returns the name of the property as it should be used in strings visible to users. This is usually the same astoString()
, 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".
-
getGetter
public String getGetter()
Returns the name of the getter method for this property as defined by the@AutoValue
class. For propertyfoo
, this will befoo
orgetFoo
orisFoo
.
-
getTypeMirror
public TypeMirror getTypeMirror()
-
getType
public String getType()
-
getKind
public TypeKind getKind()
-
getOptional
public Optionalish getOptional()
Returns anOptionalish
representing the kind of Optional that this property's type is, or null if the type is not an Optional of any kind.
-
getNullableAnnotation
public String getNullableAnnotation()
Returns the string to use as an annotation to indicate the nullability of this property. It is either the empty string, if the property is not nullable, or an annotation string with a trailing space, such as"@Nullable "
or"@javax.annotation.Nullable "
.
-
isNullable
public boolean isNullable()
-
getAccess
public String getAccess()
-
-