Class GroovyCategorySupport.CategoryMethod

All Implemented Interfaces:
MetaMember, Cloneable, Comparable
Enclosing class:
GroovyCategorySupport

public static class GroovyCategorySupport.CategoryMethod extends NewInstanceMetaMethod implements Comparable
A public static category method seen as an instance method of its first parameter type. Ordering places a more specific receiver type ahead of a less specific one. The method is not cached, because the active category set changes with the scope.
  • Constructor Details

    • CategoryMethod

      public CategoryMethod(CachedMethod metaMethod, Class metaClass)
      Wraps metaMethod and records metaClass as the receiver type used when category methods are ordered.
      Parameters:
      metaMethod - static category method
      metaClass - class of that method's first parameter, the receiver type
  • Method Details

    • isCacheable

      public boolean isCacheable()
      Description copied from class: MetaMethod
      Returns whether this object is cacheable.
      Overrides:
      isCacheable in class MetaMethod
    • compareTo

      public int compareTo(Object that)
      Sort by most specific to least specific.
      Specified by:
      compareTo in interface Comparable
      Parameters:
      that - the object to compare against