-
Method Summary
Modifier and TypeMethodDescriptionenum_()
Indicate that this field is an enum constant.final_()
Switch this field to be final.Set an initial constant value for this field.name()
Returns the name of this field.private_()
Switch this field to be private.Switch this field to be protected.public_()
Switch this field to be public.Define a signature for this member, which is a string for supporting generic types.static_()
Switch this field to be static.Indicate that this field is synthetic.Switch this field to be transient.Switch this field to be volatile.Methods inherited from interface org.cojen.maker.Maker
addAnnotation, addAttribute, classMaker
-
Method Details
-
name
-
public_
FieldMaker public_()Switch this field to be public. Fields are package-private by default. -
private_
FieldMaker private_()Switch this field to be private. Fields are package-private by default. -
protected_
FieldMaker protected_()Switch this field to be protected. Fields are package-private by default.- Specified by:
protected_
in interfaceMaker
- Returns:
- this
-
static_
FieldMaker static_()Switch this field to be static. Fields are non-static by default. -
final_
FieldMaker final_()Switch this field to be final. Fields are non-final by default. -
volatile_
FieldMaker volatile_()Switch this field to be volatile. Fields are non-volatile by default.- Returns:
- this
-
transient_
FieldMaker transient_()Switch this field to be transient. Fields are non-transient by default.- Returns:
- this
-
synthetic
FieldMaker synthetic()Indicate that this field is synthetic. Fields are non-synthetic by default. -
enum_
FieldMaker enum_()Indicate that this field is an enum constant. No checks or modifications are performed to ensure that the enum field is defined correctly.- Returns:
- this
-
signature
Define a signature for this member, which is a string for supporting generic types. The components can be strings or types (class, ClassMaker, etc.), which are concatenated into a single string. Consult the JVM specification for the signature syntax. -
init
Set an initial constant value for this field. The allowed constants are the same as those allowed by theVariable.set
method. Complex constants can be assigned using astatic initializer
.- Returns:
- this
- Throws:
IllegalStateException
- if not a static fieldIllegalArgumentException
- if the value type is unsupported, or if it's not compatible with the field type
-