net.sf.cglib.proxy.Mixin class from the cglib library.
Sample usage:
interface Sailboat {
default void trimSails() {
}
}
interface WithMain {
void trimMain();
}
interface WithJib {
void trimJib();
}
interface Sloop extends Sailboat, WithMain, WithJib {
@Override
public default void trimSails() {
System.out.println("On the sloop:");
trimMain();
trimJib();
}
}
interface Catboat extends Sailboat, WithMain {
@Override
public default void trimSails() {
System.out.println("On the catboat:");
trimMain();
}
}
final var withMain = new WithMain() {
@Override
public void trimMain() {
System.out.println(" trim the main");
}
};
final var withJib = new WithJib() {
@Override
public void trimJib() {
System.out.println(" trim the jib");
}
};
Sloop sloop = CompositeProxy.create(Sloop.class, withMain, withJib);
Catboat catboat = CompositeProxy.create(Catboat.class, withMain);
sloop.trimSails();
catboat.trimSails();
On the sloop: trim the main trim the jib On the cat: trim the main
Proxy
| Modifier and Type | Class and Description |
|---|---|
| public static class | CompositeProxy.
Builder of |
| private static record | |
| private static record | |
| private static interface | |
| public static interface | CompositeProxy.
Invocation tunnel. |
| public static interface | CompositeProxy.
Method conflict resolver. |
| private static record | |
| public static interface | CompositeProxy.
Object conflict resolver. |
| Modifier and Type | Field and Description |
|---|---|
| private static final CompositeProxy. | |
| private static final CompositeProxy. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CompositeProxy. | |
| public static <T> T | |
| private static <T> T | createCompositeProxy(Class<T> interfaceType, CompositeProxy.
|
| private static CompositeProxy. | |
| private static CompositeProxy. | |
| pack-priv static Optional | detectJPackageConfiguration(Class<?>
the interface type composite proxy instance should
implement interfaceType, Object... all objects passed to the calling composite proxy. The
value is a copy of the last parameter passed in the
slices)Builder#create(Class, Object.Returns the standard jpackage configuration if the values of
|
| private static Stream | |
| private static Stream | |
| private static List | |
| private static Stream | |
| private static Stream | |
| private static Stream | |
| private static boolean | |
| private static Stream |