Package: java.lang

## Class Class

- - ### Methods Summary

    Methods
    Return type | Name and parameters
    --- | ---
    `MetaClass` | `getMetaClass()` Adds a "metaClass" property to all class objects so you can use the syntax `String.metaClass.myMethod = { println "foo" }`
    `boolean` | `isCase(Object switchValue)` Special 'Case' implementation for Class, which allows testing for a certain class in a switch statement.
    `MetaClass` | `metaClass(Closure closure)` Sets/updates the metaclass for a given class to a closure.
    `void` | `mixin(Class categoryClass)` Extend class globally with category methods.
    `void` | `mixin(Class[] categoryClass)` Extend class globally with category methods.
    `void` | `mixin(List categoryClasses)` Extend class globally with category methods.
    `Object` | `newInstance()` Convenience method to dynamically create a new instance of this class.
    `Object` | `newInstance(Object[] args)` Helper to construct a new instance from the given arguments.
    `void` | `setMetaClass(MetaClass metaClass)` Sets the metaclass for a given class.

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

    `addShutdownHook`, `any`, `any`, `asBoolean`, `asType`, `collect`, `collect`, `collect`, `contains`, `count`, `dump`, `each`, `eachWithIndex`, `equals`, `every`, `every`, `find`, `find`, `findAll`, `findAll`, `findIndexOf`, `findIndexOf`, `findIndexValues`, `findIndexValues`, `findLastIndexOf`, `findLastIndexOf`, `findResult`, `findResult`, `flatten`, `getAt`, `getMetaClass`, `getMetaPropertyValues`, `getProperties`, `grep`, `grep`, `groupBy`, `groupBy`, `hasProperty`, `identity`, `inject`, `inject`, `inspect`, `invokeMethod`, `is`, `isCase`, `iterator`, `join`, `metaClass`, `print`, `print`, `printf`, `printf`, `println`, `println`, `println`, `putAt`, `respondsTo`, `respondsTo`, `setMetaClass`, `size`, `split`, `sprintf`, `sprintf`, `sum`, `sum`, `sum`, `sum`, `toArrayString`, `toSpreadMap`, `toString`, `use`, `use`, `use`, `with`, `withTraits`

- - ### Methods Detail

    - #### public MetaClass getMetaClass()

      Adds a "metaClass" property to all class objects so you can use the syntax `String.metaClass.myMethod = { println "foo" }`

      Returns:
        An MetaClass instance
      Since:
        1.5.0

    - #### public boolean isCase(Object switchValue)

      Special 'Case' implementation for Class, which allows testing for a certain class in a switch statement. For example:

          switch( obj ) {
            case List :
              // obj is a list
              break;
            case Set :
              // etc
          }

      Parameters:
        `switchValue` - the switch value
      Returns:
        true if the switchValue is deemed to be assignable from the given class
      Since:
        1.0

    - #### public MetaClass metaClass(Closure closure)

      Sets/updates the metaclass for a given class to a closure.

      Parameters:
        `closure` - the closure representing the new metaclass
      Returns:
        the new metaclass value
      Since:
        1.6.0

    - #### public void mixin(Class categoryClass)

      Extend class globally with category methods.

      Parameters:
        `categoryClass` - a category class to use
      Since:
        1.6.0

    - #### public void mixin(Class[] categoryClass)

      Extend class globally with category methods.

      Parameters:
        `categoryClass` - a category class to use
      Since:
        1.6.0

    - #### public void mixin(List categoryClasses)

      Extend class globally with category methods. All methods for given class and all super classes will be added to the class.

      Parameters:
        `categoryClasses` - a category classes to use
      Since:
        1.6.0

    - #### public Object newInstance()

      Convenience method to dynamically create a new instance of this class. Calls the default constructor.

      Returns:
        a new instance of this class
      Since:
        1.0

    - #### public Object newInstance(Object[] args)

      Helper to construct a new instance from the given arguments. The constructor is called based on the number and types in the args array. Use `newInstance(null)` or simply `newInstance()` for the default (no-arg) constructor.

      Parameters:
        `args` - the constructor arguments
      Returns:
        a new instance of this class.
      Since:
        1.0

    - #### public void setMetaClass(MetaClass metaClass)

      Sets the metaclass for a given class.

      Parameters:
        `metaClass` - the new MetaClass
      Since:
        1.6.0