Package com.google.auto.value.processor
Class BuilderSpec.PropertyGetter
- java.lang.Object
-
- com.google.auto.value.processor.BuilderSpec.PropertyGetter
-
- Enclosing class:
- BuilderSpec
public static class BuilderSpec.PropertyGetter extends java.lang.Object
Information about a builder property getter, referenced from the autovalue.vm template. A property called foo (defined by a methodT foo()
orT getFoo()
) can have a getter method in the builder with the same name (foo()
orgetFoo()
) and a return type of eitherT
orOptional<T>
. TheOptional<T>
form can be used to tell whether the property has been set. Here,Optional<T>
can be eitherjava.util.Optional
orcom.google.common.base.Optional
. IfT
isint
,long
, ordouble
, then instead ofOptional<T>
we can haveOptionalInt
etc. IfT
is a primitive type (including these ones but also the other five) thenOptional<T>
can be the corresponding boxed type.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
access
private Optionalish
optional
private java.lang.String
type
-
Constructor Summary
Constructors Constructor Description PropertyGetter(javax.lang.model.element.ExecutableElement method, java.lang.String type, Optionalish optional)
Makes a newPropertyGetter
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccess()
Optionalish
getOptional()
java.lang.String
getType()
-
-
-
Field Detail
-
access
private final java.lang.String access
-
type
private final java.lang.String type
-
optional
private final Optionalish optional
-
-
Constructor Detail
-
PropertyGetter
PropertyGetter(javax.lang.model.element.ExecutableElement method, java.lang.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 Detail
-
getAccess
public java.lang.String getAccess()
-
getType
public java.lang.String getType()
-
getOptional
public Optionalish getOptional()
-
-