public static class BuilderSpec.PropertyGetter
extends java.lang.Object
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.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
access |
private Optionalish |
optional |
private java.lang.String |
type |
| Constructor and Description |
|---|
PropertyGetter(javax.lang.model.element.ExecutableElement method,
java.lang.String type,
Optionalish optional)
Makes a new
PropertyGetter instance. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAccess() |
Optionalish |
getOptional() |
java.lang.String |
getType() |
private final java.lang.String access
private final java.lang.String type
private final Optionalish optional
PropertyGetter(javax.lang.model.element.ExecutableElement method,
java.lang.String type,
Optionalish optional)
PropertyGetter instance.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 be List<String> for example. It is either identical to the type of
the corresponding getter in the @AutoValue class, or it is an optional wrapper,
like Optional<List<String>>.optional - a representation of the Optional type that the getter returns, if
this is an optional getter, or null otherwise. An optional getter is one that returns
Optional<T> rather than T, as explained above.public java.lang.String getAccess()
public java.lang.String getType()
public Optionalish getOptional()