Interface DynamicType.Builder.FieldDefinition.Valuable<U>
- Type Parameters:
U
- A loaded type that the built type is guaranteed to be a subclass of.
- All Superinterfaces:
DynamicType.Builder.FieldDefinition<U>
- All Known Subinterfaces:
DynamicType.Builder.FieldDefinition.Optional.Valuable<V>
- All Known Implementing Classes:
DynamicType.Builder.AbstractBase.Adapter.FieldDefinitionAdapter
,DynamicType.Builder.AbstractBase.Adapter.FieldMatchAdapter
,DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase
,DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase.Adapter
- Enclosing interface:
- DynamicType.Builder.FieldDefinition<S>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition
DynamicType.Builder.FieldDefinition.Optional<U>, DynamicType.Builder.FieldDefinition.Valuable<U>
-
Method Summary
Modifier and TypeMethodDescriptionvalue
(boolean value) Defines the suppliedboolean
value as a default value of the previously defined or matched field.value
(double value) Defines the supplieddouble
value as a default value of the previously defined or matched field.value
(float value) Defines the suppliedfloat
value as a default value of the previously defined or matched field.value
(int value) Defines the suppliedint
value as a default value of the previously defined or matched field.value
(long value) Defines the suppliedlong
value as a default value of the previously defined or matched field.Defines the suppliedString
value as a default value of the previously defined or matched field.Methods inherited from interface net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition
annotateField, annotateField, annotateField, annotateField, attribute, transform
-
Method Details
-
value
Defines the supplied
boolean
value as a default value of the previously defined or matched field. The value can only be set for numeric fields of typeboolean
,byte
,short
,char
orint
. For non-boolean fields, the field's value is set to0
forfalse
or1
fortrue
.Important: A default value in a Java class file defines a field's value prior to the class's initialization. This value is only visible to code if the field is declared
static
. A default value can also be set for non-static fields where the value is not visible to code. The Java compiler only defines such values forfinal
fields.- Parameters:
value
- The value to define as a default value of the defined field.- Returns:
- A new builder that is equal to this builder but with the given default value declared for the previously defined or matched field.
-
value
Defines the supplied
int
value as a default value of the previously defined or matched field. The value can only be set for numeric fields of typeboolean
,byte
,short
,char
orint
where the value must be within the numeric type's range. Theboolean
type is regarded as a numeric type with the possible values of0
and1
representingfalse
andtrue
.Important: A default value in a Java class file defines a field's value prior to the class's initialization. This value is only visible to code if the field is declared
static
. A default value can also be set for non-static fields where the value is not visible to code. The Java compiler only defines such values forfinal
fields.- Parameters:
value
- The value to define as a default value of the defined field.- Returns:
- A new builder that is equal to this builder but with the given default value declared for the previously defined or matched field.
-
value
Defines the supplied
long
value as a default value of the previously defined or matched field.Important: A default value in a Java class file defines a field's value prior to the class's initialization. This value is only visible to code if the field is declared
static
. A default value can also be set for non-static fields where the value is not visible to code. The Java compiler only defines such values forfinal
fields.- Parameters:
value
- The value to define as a default value of the defined field.- Returns:
- A new builder that is equal to this builder but with the given default value declared for the previously defined or matched field.
-
value
Defines the supplied
float
value as a default value of the previously defined or matched field.Important: A default value in a Java class file defines a field's value prior to the class's initialization. This value is only visible to code if the field is declared
static
. A default value can also be set for non-static fields where the value is not visible to code. The Java compiler only defines such values forfinal
fields.- Parameters:
value
- The value to define as a default value of the defined field.- Returns:
- A new builder that is equal to this builder but with the given default value declared for the previously defined or matched field.
-
value
Defines the supplied
double
value as a default value of the previously defined or matched field.Important: A default value in a Java class file defines a field's value prior to the class's initialization. This value is only visible to code if the field is declared
static
. A default value can also be set for non-static fields where the value is not visible to code. The Java compiler only defines such values forfinal
fields.- Parameters:
value
- The value to define as a default value of the defined field.- Returns:
- A new builder that is equal to this builder but with the given default value declared for the previously defined or matched field.
-
value
Defines the supplied
String
value as a default value of the previously defined or matched field.Important: A default value in a Java class file defines a field's value prior to the class's initialization. This value is only visible to code if the field is declared
static
. A default value can also be set for non-static fields where the value is not visible to code. The Java compiler only defines such values forfinal
fields.- Parameters:
value
- The value to define as a default value of the defined field.- Returns:
- A new builder that is equal to this builder but with the given default value declared for the previously defined or matched field.
-