Package com.tonic.builder
Class FieldBuilder
- java.lang.Object
-
- com.tonic.builder.FieldBuilder
-
public class FieldBuilder extends Object
Fluent builder for a single field of a class under construction, returning to itsClassBuilderfromend().
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationBuilder<FieldBuilder>annotate(String type)Opens an annotation on this field; callAnnotationBuilder.end()to return here.FieldBuilderconstantValue(Object value)Gives the field a ConstantValue attribute.FieldBuilderdeprecated()Marks the field for a Deprecated attribute.ClassBuilderend()FieldBuildersynthetic()Adds ACC_SYNTHETIC to the field's access flags.
-
-
-
Method Detail
-
constantValue
public FieldBuilder constantValue(Object value)
Gives the field a ConstantValue attribute.- Parameters:
value- an Integer, Long, Float, Double or String constant- Returns:
- this builder
-
annotate
public AnnotationBuilder<FieldBuilder> annotate(String type)
Opens an annotation on this field; callAnnotationBuilder.end()to return here.- Parameters:
type- the annotation type- Returns:
- the annotation builder
-
synthetic
public FieldBuilder synthetic()
Adds ACC_SYNTHETIC to the field's access flags.- Returns:
- this builder
-
deprecated
public FieldBuilder deprecated()
Marks the field for a Deprecated attribute.- Returns:
- this builder
-
end
public ClassBuilder end()
- Returns:
- the class builder this field belongs to
-
-