com.intellectualcrafters.plot.util

## Class ReflectionUtils.RefClass

- java.lang.Object
- - com.intellectualcrafters.plot.util.ReflectionUtils.RefClass

- Enclosing class:
    ReflectionUtils

      public static class ReflectionUtils.RefClass
      extends java.lang.Object

  RefClass - utility to simplify work with reflections.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ReflectionUtils.RefConstructor` | `findConstructor(int number)` find constructor by number of arguments
    `ReflectionUtils.RefField` | `findField(java.lang.Class type)` find field by type
    `ReflectionUtils.RefField` | `findField(ReflectionUtils.RefClass type)` find field by type
    `ReflectionUtils.RefMethod` | `findMethod(java.lang.Object... types)` find method by type parameters
    `ReflectionUtils.RefMethod` | `findMethodByName(java.lang.String... names)` find method by name
    `ReflectionUtils.RefMethod` | `findMethodByReturnType(java.lang.Class type)` find method by return value
    `ReflectionUtils.RefMethod` | `findMethodByReturnType(ReflectionUtils.RefClass type)` find method by return value
    `ReflectionUtils.RefConstructor` | `getConstructor(java.lang.Object... types)` get existing constructor by types
    `ReflectionUtils.RefField` | `getField(java.lang.String name)` get field by name
    `ReflectionUtils.RefMethod` | `getMethod(java.lang.String name, java.lang.Object... types)` get existing method by name and types
    `java.lang.Class<?>` | `getRealClass()` get passed class
    `boolean` | `isInstance(java.lang.Object object)` see `Class.isInstance(Object)`

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

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

- - ### Method Detail

    - #### getRealClass

          public java.lang.Class<?> getRealClass()

      get passed class
      Returns:
        class

    - #### isInstance

          public boolean isInstance(java.lang.Object object)

      see `Class.isInstance(Object)`
      Parameters:
        `object` - the object to check
      Returns:
        true if object is an instance of this class

    - #### getMethod

          public ReflectionUtils.RefMethod getMethod(java.lang.String name,
                                            java.lang.Object... types)
                                              throws java.lang.NoSuchMethodException

      get existing method by name and types
      Parameters:
        `name` - name
        `types` - method parameters. can be Class or RefClass
      Returns:
        RefMethod object
      Throws:
        `java.lang.RuntimeException` - if method not found
        `java.lang.NoSuchMethodException`

    - #### getConstructor

          public ReflectionUtils.RefConstructor getConstructor(java.lang.Object... types)

      get existing constructor by types
      Parameters:
        `types` - parameters. can be Class or RefClass
      Returns:
        RefMethod object
      Throws:
        `java.lang.RuntimeException` - if constructor not found

    - #### findMethod

          public ReflectionUtils.RefMethod findMethod(java.lang.Object... types)

      find method by type parameters
      Parameters:
        `types` - parameters. can be Class or RefClass
      Returns:
        RefMethod object
      Throws:
        `java.lang.RuntimeException` - if method not found

    - #### findMethodByName

          public ReflectionUtils.RefMethod findMethodByName(java.lang.String... names)

      find method by name
      Parameters:
        `names` - possible names of method
      Returns:
        RefMethod object
      Throws:
        `java.lang.RuntimeException` - if method not found

    - #### findMethodByReturnType

          public ReflectionUtils.RefMethod findMethodByReturnType(ReflectionUtils.RefClass type)

      find method by return value
      Parameters:
        `type` - type of returned value
      Returns:
        RefMethod
      Throws:
        `java.lang.RuntimeException` - if method not found

    - #### findMethodByReturnType

          public ReflectionUtils.RefMethod findMethodByReturnType(java.lang.Class type)

      find method by return value
      Parameters:
        `type` - type of returned value
      Returns:
        RefMethod
      Throws:
        `java.lang.RuntimeException` - if method not found

    - #### findConstructor

          public ReflectionUtils.RefConstructor findConstructor(int number)

      find constructor by number of arguments
      Parameters:
        `number` - number of arguments
      Returns:
        RefConstructor
      Throws:
        `java.lang.RuntimeException` - if constructor not found

    - #### getField

          public ReflectionUtils.RefField getField(java.lang.String name)

      get field by name
      Parameters:
        `name` - field name
      Returns:
        RefField
      Throws:
        `java.lang.RuntimeException` - if field not found

    - #### findField

          public ReflectionUtils.RefField findField(ReflectionUtils.RefClass type)

      find field by type
      Parameters:
        `type` - field type
      Returns:
        RefField
      Throws:
        `java.lang.RuntimeException` - if field not found

    - #### findField

          public ReflectionUtils.RefField findField(java.lang.Class type)

      find field by type
      Parameters:
        `type` - field type
      Returns:
        RefField
      Throws:
        `java.lang.RuntimeException` - if field not found