Package com.google.auto.value.processor
Class BuilderSpec.PropertyGetter
java.lang.Object
com.google.auto.value.processor.BuilderSpec.PropertyGetter
- Enclosing class:
- BuilderSpec
Information about a builder property getter, referenced from the autovalue.vm template. A
property called foo (defined by a method
T foo()
or T getFoo()
) can have a
getter method in the builder with the same name (foo()
or getFoo()
) and a
return type of either T
or Optional<T>
. The Optional<T>
form can be
used to tell whether the property has been set. Here, Optional<T>
can be either
java.util.Optional
or com.google.common.base.Optional
. If T
is int
,
long
, or double
, then instead of Optional<T>
we can have
OptionalInt
etc. If T
is a primitive type (including these ones but also the other
five) then Optional<T>
can be the corresponding boxed type.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPropertyGetter
(ExecutableElement method, String type, Optionalish optional) Makes a newPropertyGetter
instance. -
Method Summary
-
Field Details
-
access
-
type
-
optional
-
-
Constructor Details
-
PropertyGetter
PropertyGetter(ExecutableElement method, String type, Optionalish optional) Makes a newPropertyGetter
instance.- Parameters:
method
- the source method which this getter is implementing.type
- the type that the getter returns. This is written to take imports into account, so it might beList<String>
for example. It is either identical to the type of the corresponding getter in the@AutoValue
class, or it is an optional wrapper, likeOptional<List<String>>
.optional
- a representation of theOptional
type that the getter returns, if this is an optional getter, or null otherwise. An optional getter is one that returnsOptional<T>
rather thanT
, as explained above.
-
-
Method Details
-
getAccess
-
getType
-
getOptional
-