Package org.optaplanner.core.impl.domain.common.accessor.gizmo

## Class GizmoMemberDescriptor

- java.lang.Object
- - org.optaplanner.core.impl.domain.common.accessor.gizmo.GizmoMemberDescriptor

-     public class GizmoMemberDescriptor
      extends Object

  Describe and provide simplified/unified access for a Member

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GizmoMemberDescriptor​(Member member)` |
    `GizmoMemberDescriptor​(String name, Object memberDescriptor, Class<?> declaringClass, AnnotatedElement annotatedElement, Type type)` |
    `GizmoMemberDescriptor​(String name, Object memberDescriptor, Class<?> declaringClass, AnnotatedElement annotatedElement, Type type, io.quarkus.gizmo.MethodDescriptor setterDescriptor)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `AnnotatedElement` | `getAnnotatedElement()` |
    `String` | `getDeclaringClassName()` | Returns the declaring class name of the member in descriptor format.
    `String` | `getName()` |
    `Optional<io.quarkus.gizmo.MethodDescriptor>` | `getSetter()` |
    `Type` | `getType()` |
    `String` | `getTypeName()` | Returns the member type (for fields) / return type (for methods) name.
    `io.quarkus.gizmo.ResultHandle` | `invokeMemberMethod​(io.quarkus.gizmo.BytecodeCreator creator, io.quarkus.gizmo.MethodDescriptor method, io.quarkus.gizmo.ResultHandle bean, io.quarkus.gizmo.ResultHandle... parameters)` |
    `boolean` | `isInterfaceMethod()` | Returns true iff the getter is from an interface.
    `String` | `toString()` |
    `GizmoMemberDescriptor` | `whenIsField​(Consumer<io.quarkus.gizmo.FieldDescriptor> fieldDescriptorConsumer)` | If the member is a field, pass the member's field descriptor to the provided consumer.
    `GizmoMemberDescriptor` | `whenIsMethod​(Consumer<io.quarkus.gizmo.MethodDescriptor> methodDescriptorConsumer)` | If the member is a method, pass the member's method descriptor to the provided consumer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### GizmoMemberDescriptor

          public GizmoMemberDescriptor​(Member member)

    - #### GizmoMemberDescriptor

          public GizmoMemberDescriptor​(String name,
                                       Object memberDescriptor,
                                       Class<?> declaringClass,
                                       AnnotatedElement annotatedElement,
                                       Type type)

    - #### GizmoMemberDescriptor

          public GizmoMemberDescriptor​(String name,
                                       Object memberDescriptor,
                                       Class<?> declaringClass,
                                       AnnotatedElement annotatedElement,
                                       Type type,
                                       io.quarkus.gizmo.MethodDescriptor setterDescriptor)

  - ### Method Detail

    - #### whenIsField

          public GizmoMemberDescriptor whenIsField​(Consumer<io.quarkus.gizmo.FieldDescriptor> fieldDescriptorConsumer)

      If the member 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.gizmo.MethodDescriptor> methodDescriptorConsumer)

      If the member 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

    - #### getDeclaringClassName

          public String 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

    - #### isInterfaceMethod

          public boolean isInterfaceMethod()

      Returns true iff the getter is from an interface.
      Returns:
        true iff the getter is from an interface

    - #### invokeMemberMethod

          public io.quarkus.gizmo.ResultHandle invokeMemberMethod​(io.quarkus.gizmo.BytecodeCreator creator,
                                                                  io.quarkus.gizmo.MethodDescriptor method,
                                                                  io.quarkus.gizmo.ResultHandle bean,
                                                                  io.quarkus.gizmo.ResultHandle... parameters)

    - #### getSetter

          public Optional<io.quarkus.gizmo.MethodDescriptor> getSetter()

    - #### getName

          public String getName()

    - #### getTypeName

          public String getTypeName()

      Returns the member type (for fields) / return type (for methods) name. The name does not include generic infomation.

    - #### getType

          public Type getType()

    - #### getAnnotatedElement

          public AnnotatedElement getAnnotatedElement()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`