Record Class DefaultClassTransformerRegistry.RegisteredClassTransformer
java.lang.Object
java.lang.Record
eu.cloudnetservice.wrapper.transform.DefaultClassTransformerRegistry.RegisteredClassTransformer
- Record Components:
transformer- the transformer to obtain the class file transform instance from for accepted classes.instrumentation- the instrumentation to which this transformer is registered.
- All Implemented Interfaces:
ClassFileTransformer
- Enclosing class:
DefaultClassTransformerRegistry
private static record DefaultClassTransformerRegistry.RegisteredClassTransformer(@NonNull ClassTransformer transformer, @NonNull Instrumentation instrumentation)
extends Record
implements ClassFileTransformer
An implementation of a class file transformer that parses and transforms class files using the given CloudNet
transformer. The transform call is ignored if the given transformer is rejecting the class, and this transformer
will be unregistered from the given instrumentation if the acceptance check returns
ClassTransformer.TransformWillingness.ACCEPT_ONCE.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull InstrumentationThe field for theinstrumentationrecord component.private final @NonNull ClassTransformerThe field for thetransformerrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRegisteredClassTransformer(@NonNull ClassTransformer transformer, @NonNull Instrumentation instrumentation) Creates an instance of aRegisteredClassTransformerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinstrumentationrecord component.final StringtoString()Returns a string representation of this record class.byte[]transform(@Nullable ClassLoader loader, @NonNull String className, @Nullable Class<?> classBeingRedefined, @Nullable ProtectionDomain protectionDomain, byte[] classfileBuffer) Returns the value of thetransformerrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.instrument.ClassFileTransformer
transform
-
Field Details
-
transformer
The field for thetransformerrecord component. -
instrumentation
The field for theinstrumentationrecord component.
-
-
Constructor Details
-
RegisteredClassTransformer
private RegisteredClassTransformer(@NonNull @NonNull ClassTransformer transformer, @NonNull @NonNull Instrumentation instrumentation) Creates an instance of aRegisteredClassTransformerrecord class.- Parameters:
transformer- the value for thetransformerrecord componentinstrumentation- the value for theinstrumentationrecord component
-
-
Method Details
-
transform
public byte[] transform(@Nullable @Nullable ClassLoader loader, @NonNull @NonNull String className, @Nullable @Nullable Class<?> classBeingRedefined, @Nullable @Nullable ProtectionDomain protectionDomain, byte[] classfileBuffer) - Specified by:
transformin interfaceClassFileTransformer
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
transformer
Returns the value of thetransformerrecord component.- Returns:
- the value of the
transformerrecord component
-
instrumentation
Returns the value of theinstrumentationrecord component.- Returns:
- the value of the
instrumentationrecord component
-