Class GizmoMemberDescriptor
java.lang.Object
ai.timefold.solver.core.impl.domain.common.accessor.gizmo.GizmoMemberDescriptor
Describe and provide simplified/unified access for
Member.-
Constructor Summary
ConstructorsConstructorDescriptionGizmoMemberDescriptor(Member member) GizmoMemberDescriptor(Member member, boolean methodWithParameter) GizmoMemberDescriptor(String name, io.quarkus.gizmo2.desc.FieldDesc fieldDescriptor, Class<?> declaringClass) GizmoMemberDescriptor(String name, io.quarkus.gizmo2.desc.MethodDesc memberDescriptor, io.quarkus.gizmo2.desc.FieldDesc metadataDescriptor, Type methodParameterType, Class<?> declaringClass, io.quarkus.gizmo2.desc.MethodDesc setterDescriptor) GizmoMemberDescriptor(String name, io.quarkus.gizmo2.desc.MethodDesc memberDescriptor, io.quarkus.gizmo2.desc.MethodDesc metadataDescriptor, Type methodParameterType, Class<?> declaringClass, io.quarkus.gizmo2.desc.MethodDesc setterDescriptor) GizmoMemberDescriptor(String name, io.quarkus.gizmo2.desc.MethodDesc memberDescriptor, Type methodParameterType, Class<?> declaringClass, io.quarkus.gizmo2.desc.MethodDesc setterDescriptor) -
Method Summary
Modifier and TypeMethodDescriptionReturns the declaring class name of the member in descriptor format.static TypegetMethodParameterType(Method method, boolean methodWithParameter) getName()Optional<io.quarkus.gizmo2.desc.MethodDesc>getType()Returns the member type (for fields) / return type (for methods) name.io.quarkus.gizmo2.ExprreadMemberValue(io.quarkus.gizmo2.creator.BlockCreator bytecodeCreator, io.quarkus.gizmo2.Expr thisObj) io.quarkus.gizmo2.ExprreadMemberValue(io.quarkus.gizmo2.creator.BlockCreator bytecodeCreator, io.quarkus.gizmo2.Expr thisObj, io.quarkus.gizmo2.Expr parameter) toString()whenIsField(Consumer<io.quarkus.gizmo2.desc.FieldDesc> fieldDescriptorConsumer) If the member accessor is a field, pass the member's field descriptor to the provided consumer.whenIsMethod(Consumer<io.quarkus.gizmo2.desc.MethodDesc> methodDescriptorConsumer) If the member accessor is a method, pass the member's method descriptor to the provided consumer.whenMetadataIsOnField(Consumer<io.quarkus.gizmo2.desc.FieldDesc> fieldDescriptorConsumer) If the member metadata is on a field, pass the member's field descriptor to the provided consumer.whenMetadataIsOnMethod(Consumer<io.quarkus.gizmo2.desc.MethodDesc> methodDescriptorConsumer) If the member metadata is on a method, pass the member's method descriptor to the provided consumer.booleanwriteMemberValue(io.quarkus.gizmo2.creator.BlockCreator bytecodeCreator, io.quarkus.gizmo2.Expr thisObj, io.quarkus.gizmo2.Expr newValue) Write the bytecode for writing to this member.
-
Constructor Details
-
GizmoMemberDescriptor
-
GizmoMemberDescriptor
-
GizmoMemberDescriptor
-
GizmoMemberDescriptor
-
GizmoMemberDescriptor
-
GizmoMemberDescriptor
-
-
Method Details
-
getMethodParameterType
-
whenIsField
public GizmoMemberDescriptor whenIsField(Consumer<io.quarkus.gizmo2.desc.FieldDesc> fieldDescriptorConsumer) If the member accessor is a field, pass the member's field descriptor to the provided consumer. Otherwise, do nothing. Returns self for chaining.- Parameters:
fieldDescriptorConsumer- What to do if the member a field.- Returns:
- this
-
whenIsMethod
public GizmoMemberDescriptor whenIsMethod(Consumer<io.quarkus.gizmo2.desc.MethodDesc> methodDescriptorConsumer) If the member accessor is a method, pass the member's method descriptor to the provided consumer. Otherwise, do nothing. Returns self for chaining.- Parameters:
methodDescriptorConsumer- What to do if the member a method.- Returns:
- this
-
readMemberValue
public io.quarkus.gizmo2.Expr readMemberValue(io.quarkus.gizmo2.creator.BlockCreator bytecodeCreator, io.quarkus.gizmo2.Expr thisObj) -
readMemberValue
public io.quarkus.gizmo2.Expr readMemberValue(io.quarkus.gizmo2.creator.BlockCreator bytecodeCreator, io.quarkus.gizmo2.Expr thisObj, io.quarkus.gizmo2.Expr parameter) -
writeMemberValue
public boolean writeMemberValue(io.quarkus.gizmo2.creator.BlockCreator bytecodeCreator, io.quarkus.gizmo2.Expr thisObj, io.quarkus.gizmo2.Expr newValue) Write the bytecode for writing to this member. If there is no setter, it write the bytecode for throwing the exception. Return true if it was able to write the member value.- Parameters:
bytecodeCreator- the bytecode creator to usethisObj- the bean to write the new value tonewValue- to new value of the member- Returns:
- True if it was able to write the member value, false otherwise
-
whenMetadataIsOnField
public GizmoMemberDescriptor whenMetadataIsOnField(Consumer<io.quarkus.gizmo2.desc.FieldDesc> fieldDescriptorConsumer) If the member metadata is on a field, pass the member's field descriptor to the provided consumer. Otherwise, do nothing. Returns self for chaining.- Parameters:
fieldDescriptorConsumer- What to do if the member a field.- Returns:
- this
-
whenMetadataIsOnMethod
public GizmoMemberDescriptor whenMetadataIsOnMethod(Consumer<io.quarkus.gizmo2.desc.MethodDesc> methodDescriptorConsumer) If the member metadata is on a method, pass the member's method descriptor to the provided consumer. Otherwise, do nothing. Returns self for chaining.- Parameters:
methodDescriptorConsumer- What to do if the member a method.- Returns:
- this
-
getDeclaringClassName
Returns the declaring class name of the member in descriptor format. For instance, the declaring class name of Object.toString() is "java/lang/Object".- Returns:
- Returns the declaring class name of the member in descriptor format
-
getSetter
-
getName
-
getTypeName
Returns the member type (for fields) / return type (for methods) name. The name does not include generic information. -
getType
-
getMethodParameterType
-
toString
-