Record Class CodeGenerationUtil.PrimitiveWrapperConverter
java.lang.Object
java.lang.Record
eu.cloudnetservice.utils.base.CodeGenerationUtil.PrimitiveWrapperConverter
- Record Components:
wrapperType- the descriptor of the wrapper type.primitiveType- the descriptor of the primitive type.toWrapperMethod- the method to call to convert from primitive to wrapper on the wrapper type.fromWrapperMethod- the method to call to convert from the wrapper to the primitive type.toWrapperDesc- the descriptor of the method used to box the primitive.fromWrapperDesc- the descriptor of the method used to unbox the primitive.
- Enclosing class:
CodeGenerationUtil
private static record CodeGenerationUtil.PrimitiveWrapperConverter(@NonNull ClassDesc wrapperType, @NonNull ClassDesc primitiveType, @NonNull String toWrapperMethod, @NonNull String fromWrapperMethod, @NonNull MethodTypeDesc toWrapperDesc, @NonNull MethodTypeDesc fromWrapperDesc)
extends Record
Holds all information required to generate code to box or unbox a primitive type.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull MethodTypeDescThe field for thefromWrapperDescrecord component.The field for thefromWrapperMethodrecord component.The field for theprimitiveTyperecord component.private final @NonNull MethodTypeDescThe field for thetoWrapperDescrecord component.The field for thetoWrapperMethodrecord component.The field for thewrapperTyperecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrimitiveWrapperConverter(@NonNull ClassDesc wrapperTypeDesc, @NonNull ClassDesc primitiveTypeDesc) Constructs a new converter instance for the given wrapper and primitive type.privatePrimitiveWrapperConverter(@NonNull ClassDesc wrapperType, @NonNull ClassDesc primitiveType, @NonNull String toWrapperMethod, @NonNull String fromWrapperMethod, @NonNull MethodTypeDesc toWrapperDesc, @NonNull MethodTypeDesc fromWrapperDesc) Creates an instance of aPrimitiveWrapperConverterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefromWrapperDescrecord component.Returns the value of thefromWrapperMethodrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theprimitiveTyperecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetoWrapperDescrecord component.Returns the value of thetoWrapperMethodrecord component.Returns the value of thewrapperTyperecord component.
-
Field Details
-
wrapperType
The field for thewrapperTyperecord component. -
primitiveType
The field for theprimitiveTyperecord component. -
toWrapperMethod
The field for thetoWrapperMethodrecord component. -
fromWrapperMethod
The field for thefromWrapperMethodrecord component. -
toWrapperDesc
The field for thetoWrapperDescrecord component. -
fromWrapperDesc
The field for thefromWrapperDescrecord component.
-
-
Constructor Details
-
PrimitiveWrapperConverter
private PrimitiveWrapperConverter(@NonNull @NonNull ClassDesc wrapperTypeDesc, @NonNull @NonNull ClassDesc primitiveTypeDesc) Constructs a new converter instance for the given wrapper and primitive type.- Parameters:
wrapperTypeDesc- the type descriptor of the wrapper type.primitiveTypeDesc- the type descriptor of the primitive type.- Throws:
NullPointerException- if the given wrapper or primitive type is null.
-
PrimitiveWrapperConverter
private PrimitiveWrapperConverter(@NonNull @NonNull ClassDesc wrapperType, @NonNull @NonNull ClassDesc primitiveType, @NonNull @NonNull String toWrapperMethod, @NonNull @NonNull String fromWrapperMethod, @NonNull @NonNull MethodTypeDesc toWrapperDesc, @NonNull @NonNull MethodTypeDesc fromWrapperDesc) Creates an instance of aPrimitiveWrapperConverterrecord class.- Parameters:
wrapperType- the value for thewrapperTyperecord componentprimitiveType- the value for theprimitiveTyperecord componenttoWrapperMethod- the value for thetoWrapperMethodrecord componentfromWrapperMethod- the value for thefromWrapperMethodrecord componenttoWrapperDesc- the value for thetoWrapperDescrecord componentfromWrapperDesc- the value for thefromWrapperDescrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
wrapperType
Returns the value of thewrapperTyperecord component.- Returns:
- the value of the
wrapperTyperecord component
-
primitiveType
Returns the value of theprimitiveTyperecord component.- Returns:
- the value of the
primitiveTyperecord component
-
toWrapperMethod
Returns the value of thetoWrapperMethodrecord component.- Returns:
- the value of the
toWrapperMethodrecord component
-
fromWrapperMethod
Returns the value of thefromWrapperMethodrecord component.- Returns:
- the value of the
fromWrapperMethodrecord component
-
toWrapperDesc
Returns the value of thetoWrapperDescrecord component.- Returns:
- the value of the
toWrapperDescrecord component
-
fromWrapperDesc
Returns the value of thefromWrapperDescrecord component.- Returns:
- the value of the
fromWrapperDescrecord component
-