Class DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase<U>
- java.lang.Object
-
- net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase<U>
-
- net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.Delegator<U>
-
- net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition.Optional.AbstractBase<U>
-
- net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase<U>
-
- Type Parameters:
U- A loaded type that the built type is guaranteed to be a subclass of.
- All Implemented Interfaces:
DynamicType.Builder<U>,DynamicType.Builder.FieldDefinition<U>,DynamicType.Builder.FieldDefinition.Optional<U>,DynamicType.Builder.FieldDefinition.Optional.Valuable<U>,DynamicType.Builder.FieldDefinition.Valuable<U>
- Direct Known Subclasses:
DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase.Adapter
- Enclosing interface:
- DynamicType.Builder.FieldDefinition.Optional.Valuable<V>
public abstract static class DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase<U> extends DynamicType.Builder.FieldDefinition.Optional.AbstractBase<U> implements DynamicType.Builder.FieldDefinition.Optional.Valuable<U>
An abstract base implementation of an optional field definition that allows for defining a value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase.Adapter<V>An adapter for an optional field definition that allows for defining a value.-
Nested classes/interfaces inherited from class net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase
DynamicType.Builder.AbstractBase.Delegator<U>
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Builder
DynamicType.Builder.AbstractBase<S>, DynamicType.Builder.FieldDefinition<S>, DynamicType.Builder.InnerTypeDefinition<S>, DynamicType.Builder.MethodDefinition<S>, DynamicType.Builder.RecordComponentDefinition<S>, DynamicType.Builder.TypeVariableDefinition<S>
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition
DynamicType.Builder.FieldDefinition.Optional<U>, DynamicType.Builder.FieldDefinition.Valuable<U>
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition.Optional
DynamicType.Builder.FieldDefinition.Optional.AbstractBase<U>, DynamicType.Builder.FieldDefinition.Optional.Valuable<V>
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition.Optional.Valuable
DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase<U>
-
-
Constructor Summary
Constructors Constructor Description AbstractBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract DynamicType.Builder.FieldDefinition.Optional<U>defaultValue(java.lang.Object defaultValue)Defines the supplied value as a default value of the previously defined or matched field.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 class net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition.Optional.AbstractBase
annotateField, annotateField, annotateField
-
Methods inherited from class net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.Delegator
annotateType, attribute, declaredTypes, define, defineConstructor, defineField, defineMethod, defineRecordComponent, field, ignoreAlso, ignoreAlso, implement, initializer, initializer, innerTypeOf, innerTypeOf, invokable, make, make, make, make, materialize, merge, modifiers, name, nestHost, nestMembers, permittedSubclass, recordComponent, recordComponent, require, suffix, topLevelType, toTypeDescription, transform, typeVariable, unsealed, visit
-
Methods inherited from class net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase
annotateType, annotateType, annotateType, constructor, declaredTypes, declaredTypes, declaredTypes, define, define, define, define, define, defineConstructor, defineConstructor, defineField, defineField, defineField, defineField, defineField, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineProperty, defineProperty, defineProperty, defineProperty, defineRecordComponent, field, implement, implement, implement, innerTypeOf, innerTypeOf, innerTypeOf, invokable, merge, method, modifiers, modifiers, nestHost, nestMembers, nestMembers, nestMembers, noNestMate, permittedSubclass, permittedSubclass, permittedSubclass, require, require, require, serialVersionUid, typeVariable, typeVariable, typeVariable, typeVariable, withHashCodeEquals, withToString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.dynamic.DynamicType.Builder
annotateType, annotateType, annotateType, annotateType, attribute, constructor, declaredTypes, declaredTypes, declaredTypes, declaredTypes, define, define, define, define, define, define, defineConstructor, defineConstructor, defineConstructor, defineField, defineField, defineField, defineField, defineField, defineField, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineProperty, defineProperty, defineProperty, defineProperty, defineRecordComponent, defineRecordComponent, field, field, ignoreAlso, ignoreAlso, implement, implement, implement, implement, initializer, initializer, innerTypeOf, innerTypeOf, innerTypeOf, innerTypeOf, innerTypeOf, invokable, invokable, make, make, make, make, merge, merge, method, modifiers, modifiers, modifiers, name, nestHost, nestHost, nestMembers, nestMembers, nestMembers, nestMembers, noNestMate, permittedSubclass, permittedSubclass, permittedSubclass, permittedSubclass, recordComponent, recordComponent, require, require, require, require, serialVersionUid, suffix, topLevelType, toTypeDescription, transform, typeVariable, typeVariable, typeVariable, typeVariable, typeVariable, unsealed, visit, withHashCodeEquals, withToString
-
Methods inherited from interface net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition
annotateField, annotateField, annotateField, annotateField, attribute, transform
-
-
-
-
Method Detail
-
value
public 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.- Specified by:
valuein interfaceDynamicType.Builder.FieldDefinition.Valuable<U>- 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
public 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.- Specified by:
valuein interfaceDynamicType.Builder.FieldDefinition.Valuable<U>- 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
public 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.- Specified by:
valuein interfaceDynamicType.Builder.FieldDefinition.Valuable<U>- 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
public 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.- Specified by:
valuein interfaceDynamicType.Builder.FieldDefinition.Valuable<U>- 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
public 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.- Specified by:
valuein interfaceDynamicType.Builder.FieldDefinition.Valuable<U>- 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
public 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.- Specified by:
valuein interfaceDynamicType.Builder.FieldDefinition.Valuable<U>- 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.
-
defaultValue
protected abstract DynamicType.Builder.FieldDefinition.Optional<U> defaultValue(java.lang.Object defaultValue)
Defines the supplied value as a default value of the previously defined or matched field.- Parameters:
defaultValue- 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.
-
-