Package utilities.util
Enum Class ProxyUtilities
- All Implemented Interfaces:
Serializable,Comparable<ProxyUtilities>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareSameMethod(Method m1, Method m2) Check if two methods are the same, ignoring the declaring class.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.static MethodHandlegetSuperMethodHandle(Method method) static MethodHandlegetSuperMethodHandle(Method method, MethodHandles.Lookup lookup) static ProxyUtilitiesReturns the enum constant of this class with the specified name.static ProxyUtilities[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
areSameMethod
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 methodm2- the second method- Returns:
- true if they are the same, false otherwise;
-
getSuperMethodHandle
- 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 typeU- a super interface common to all mixins- Parameters:
iface- an interface of the delegate that also defines the proxy's typedelegate- the delegate, providing implementations of all abstract methodsmixins- the mixinslookup- a lookup which has access to the interfaces and their methods
-