Enum Class ProxyUtilities

java.lang.Object
java.lang.Enum<ProxyUtilities>
utilities.util.ProxyUtilities
All Implemented Interfaces:
Serializable, Comparable<ProxyUtilities>, Constable

public enum ProxyUtilities extends Enum<ProxyUtilities>
  • Method Details

    • values

      public static ProxyUtilities[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ProxyUtilities valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • areSameMethod

      public static boolean areSameMethod(Method m1, Method m2)
      Check if two methods are the same, ignoring the declaring class. This returns true if all the following are met: 1) They have the same name, 2) They have the same return type, and 3) They have the same parameter types.
      Parameters:
      m1 - the first method
      m2 - the second method
      Returns:
      true if they are the same, false otherwise;
    • getSuperMethodHandle

      public static MethodHandle getSuperMethodHandle(Method method) throws IllegalAccessException
      Throws:
      IllegalAccessException
    • getSuperMethodHandle

      public static MethodHandle getSuperMethodHandle(Method method, MethodHandles.Lookup lookup) throws IllegalAccessException
      Throws:
      IllegalAccessException
    • composeOnDelegate

      public static <T, U> T composeOnDelegate(Class<T> iface, T delegate, List<Class<? extends U>> mixins, MethodHandles.Lookup lookup)
      Mix-in interfaces with default methods atop the given delegate. Where both the delegate and a mixin provide an implementation, the delegate's is preferred.
      Type Parameters:
      T - the delegate's and proxy's type
      U - a super interface common to all mixins
      Parameters:
      iface - an interface of the delegate that also defines the proxy's type
      delegate - the delegate, providing implementations of all abstract methods
      mixins - the mixins
      lookup - a lookup which has access to the interfaces and their methods