Package com.google.auto.value.processor
Class AutoValueOrOneOfProcessor.Property
java.lang.Object
com.google.auto.value.processor.AutoValueOrOneOfProcessor.Property
- Enclosing class:
AutoValueOrOneOfProcessor
A property of an
@AutoValue or @AutoOneOf 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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.collect.ImmutableList<String> private final Stringprivate final ExecutableElementprivate final Stringprivate final Optionalishprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the name of the getter method for this property as defined by the@AutoValueclass.getKind()getName()Returns the name of the property as it should be used in strings visible to users.final StringReturns the string to use as a method annotation to indicate the nullability of this property.Returns anOptionalishrepresenting the kind of Optional that this property's type is, or null if the type is not an Optional of any kind.getType()inthashCode()booleantoString()Returns the name of the property as it should be used when declaring identifiers (fields and parameters).
-
Field Details
-
name
-
identifier
-
method
-
type
-
annotations
-
nullableAnnotation
-
optional
-
-
Constructor Details
-
Property
-
-
Method Details
-
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, sincepackageis a reserved word. -
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
Returns the name of the getter method for this property as defined by the@AutoValueclass. For propertyfoo, this will befooorgetFooorisFoo. -
getTypeMirror
-
getType
-
getKind
-
getAnnotations
-
getOptional
Returns anOptionalishrepresenting the kind of Optional that this property's type is, or null if the type is not an Optional of any kind. -
getNullableAnnotation
Returns the string to use as a method 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"@`javax.annotation.Nullable` ", where the``is the encoding used byTypeEncoder. If the property is nullable by virtue of its type rather than its method being@Nullable, this method returns the empty string, because the@Nullablewill appear when the type is spelled out. In this case,nullableAnnotationis present but empty. -
isNullable
public boolean isNullable() -
getAccess
-
equals
-
hashCode
public int hashCode()
-