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>
public static interface DynamicType.Builder.FieldDefinition.Valuable<U> extends DynamicType.Builder.FieldDefinition<U>
A builder for a field definition that allows for defining a value.
-
-
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DynamicType.Builder.FieldDefinition.Optional<U>value(boolean value)Defines the suppliedbooleanvalue as a default value of the previously defined or matched field.DynamicType.Builder.FieldDefinition.Optional<U>value(double value)Defines the supplieddoublevalue as a default value of the previously defined or matched field.DynamicType.Builder.FieldDefinition.Optional<U>value(float value)Defines the suppliedfloatvalue as a default value of the previously defined or matched field.DynamicType.Builder.FieldDefinition.Optional<U>value(int value)Defines the suppliedintvalue as a default value of the previously defined or matched field.DynamicType.Builder.FieldDefinition.Optional<U>value(long value)Defines the suppliedlongvalue as a default value of the previously defined or matched field.DynamicType.Builder.FieldDefinition.Optional<U>value(java.lang.String value)Defines the suppliedStringvalue 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 Detail
-
value
DynamicType.Builder.FieldDefinition.Optional<U> value(boolean value)
Defines the supplied
booleanvalue as a default value of the previously defined or matched field. The value can only be set for numeric fields of typeboolean,byte,short,charorint. For non-boolean fields, the field's value is set to0forfalseor1fortrue.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 forfinalfields.- 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
DynamicType.Builder.FieldDefinition.Optional<U> value(int value)
Defines the supplied
intvalue as a default value of the previously defined or matched field. The value can only be set for numeric fields of typeboolean,byte,short,charorintwhere the value must be within the numeric type's range. Thebooleantype is regarded as a numeric type with the possible values of0and1representingfalseandtrue.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 forfinalfields.- 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
DynamicType.Builder.FieldDefinition.Optional<U> value(long value)
Defines the supplied
longvalue 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 forfinalfields.- 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
DynamicType.Builder.FieldDefinition.Optional<U> value(float value)
Defines the supplied
floatvalue 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 forfinalfields.- 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
DynamicType.Builder.FieldDefinition.Optional<U> value(double value)
Defines the supplied
doublevalue 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 forfinalfields.- 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
DynamicType.Builder.FieldDefinition.Optional<U> value(java.lang.String value)
Defines the supplied
Stringvalue 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 forfinalfields.- 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.
-
-