Interface UnsafeBeanWriteProperty<B,T>
- Type Parameters:
B- The bean typeT- The bean property type
- All Superinterfaces:
AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, ArgumentCoercible<T>, BeanWriteProperty<B,T>, Named
- All Known Subinterfaces:
UnsafeBeanProperty<B,T>
- All Known Implementing Classes:
AbstractBeanProperty
Primitive unsafe write methods are part of the generated-introspection dispatch contract.
Their default implementations keep custom UnsafeBeanWriteProperty implementations
compatible by boxing the primitive value and delegating to setUnsafe(Object, Object).
Generated Micronaut bean properties override these methods and route them through primitive
dispatch methods so hot paths can write primitive values without allocating boxed wrappers.
- Since:
- 4.4.0
- Author:
- Denis Stepanov
-
Field Summary
Fields inherited from interface AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface AnnotationSource
EMPTY -
Method Summary
Modifier and TypeMethodDescriptiondefault voidsetBooleanUnsafe(B bean, boolean value) Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forbooleanvalues.default voidsetByteUnsafe(B bean, byte value) Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forbytevalues.default voidsetCharUnsafe(B bean, char value) Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forcharvalues.default voidsetDoubleUnsafe(B bean, double value) Unsafe primitive version ofBeanWriteProperty.set(Object, Object)fordoublevalues.default voidsetFloatUnsafe(B bean, float value) Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forfloatvalues.default voidsetIntUnsafe(B bean, int value) Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forintvalues.default voidsetLongUnsafe(B bean, long value) Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forlongvalues.default voidsetShortUnsafe(B bean, short value) Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forshortvalues.voidUnsafe version ofBeanWriteProperty.set(Object, Object).withValueUnsafe(B bean, @Nullable T value) Unsafe version ofBeanWriteProperty.withValue(Object, Object).Methods inherited from interface AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullableMethods inherited from interface AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods inherited from interface AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface AnnotationMetadataProvider
getAnnotationMetadataMethods inherited from interface BeanWriteProperty
asArgument, convertAndSet, getDeclaringBean, getDeclaringType, getType, set, withValue
-
Method Details
-
withValueUnsafe
Unsafe version ofBeanWriteProperty.withValue(Object, Object).- Parameters:
bean- The beanvalue- The new value- Returns:
- Either the existing instance or the property is mutable or a newly created instance via the copy constructor pattern.
-
setUnsafe
Unsafe version ofBeanWriteProperty.set(Object, Object).- Parameters:
bean- The beanvalue- The value to write
-
setBooleanUnsafe
Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forbooleanvalues.The default implementation boxes and delegates to
setUnsafe(Object, Object). Generated introspections override this method when a primitive dispatch target is available.- Parameters:
bean- The beanvalue- The primitive value- Since:
- 5.1.0
-
setByteUnsafe
Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forbytevalues.The default implementation boxes and delegates to
setUnsafe(Object, Object). Generated introspections override this method when a primitive dispatch target is available.- Parameters:
bean- The beanvalue- The primitive value- Since:
- 5.1.0
-
setShortUnsafe
Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forshortvalues.The default implementation boxes and delegates to
setUnsafe(Object, Object). Generated introspections override this method when a primitive dispatch target is available.- Parameters:
bean- The beanvalue- The primitive value- Since:
- 5.1.0
-
setCharUnsafe
Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forcharvalues.The default implementation boxes and delegates to
setUnsafe(Object, Object). Generated introspections override this method when a primitive dispatch target is available.- Parameters:
bean- The beanvalue- The primitive value- Since:
- 5.1.0
-
setIntUnsafe
Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forintvalues.The default implementation boxes and delegates to
setUnsafe(Object, Object). Generated introspections override this method when a primitive dispatch target is available.- Parameters:
bean- The beanvalue- The primitive value- Since:
- 5.1.0
-
setLongUnsafe
Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forlongvalues.The default implementation boxes and delegates to
setUnsafe(Object, Object). Generated introspections override this method when a primitive dispatch target is available.- Parameters:
bean- The beanvalue- The primitive value- Since:
- 5.1.0
-
setFloatUnsafe
Unsafe primitive version ofBeanWriteProperty.set(Object, Object)forfloatvalues.The default implementation boxes and delegates to
setUnsafe(Object, Object). Generated introspections override this method when a primitive dispatch target is available.- Parameters:
bean- The beanvalue- The primitive value- Since:
- 5.1.0
-
setDoubleUnsafe
Unsafe primitive version ofBeanWriteProperty.set(Object, Object)fordoublevalues.The default implementation boxes and delegates to
setUnsafe(Object, Object). Generated introspections override this method when a primitive dispatch target is available.- Parameters:
bean- The beanvalue- The primitive value- Since:
- 5.1.0
-