Module org.glavo.classfile
Package org.glavo.classfile.components
Record Class CodeRelabeler.CodeRelabelerImpl
java.lang.Object
java.lang.Record
org.glavo.classfile.components.CodeRelabeler.CodeRelabelerImpl
- All Implemented Interfaces:
ClassfileTransform<CodeTransform,,CodeElement, CodeBuilder> CodeTransform,CodeRelabeler
- Enclosing interface:
CodeRelabeler
public static record CodeRelabeler.CodeRelabelerImpl(BiFunction<Label,CodeBuilder,Label> mapFunction)
extends Record
implements CodeRelabeler
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glavo.classfile.ClassfileTransform
ClassfileTransform.ResolvedTransform<E extends ClassfileElement>Nested classes/interfaces inherited from interface org.glavo.classfile.components.CodeRelabeler
CodeRelabeler.CodeRelabelerImpl -
Field Summary
Fields inherited from interface org.glavo.classfile.CodeTransform
ACCEPT_ALL -
Constructor Summary
ConstructorsConstructorDescriptionCodeRelabelerImpl(BiFunction<Label, CodeBuilder, Label> mapFunction) Creates an instance of aCodeRelabelerImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(CodeBuilder cob, CodeElement coe) Transform an element by taking the appropriate actions on the builder.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themapFunctionrecord component.relabel(Label label, CodeBuilder cob) Access method to internal re-labeling function.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.glavo.classfile.ClassfileTransform
atEnd, atStartMethods inherited from interface org.glavo.classfile.CodeTransform
andThen, resolve
-
Constructor Details
-
CodeRelabelerImpl
Creates an instance of aCodeRelabelerImplrecord class.- Parameters:
mapFunction- the value for themapFunctionrecord component
-
-
Method Details
-
relabel
Description copied from interface:CodeRelabelerAccess method to internal re-labeling function.- Specified by:
relabelin interfaceCodeRelabeler- Parameters:
label- source labelcob- builder to create new labels- Returns:
- target label
-
accept
Description copied from interface:ClassfileTransformTransform an element by taking the appropriate actions on the builder. Used when transforming a classfile entity (class, method, field, method body.) If no transformation is desired, the element can be presented toClassfileBuilder.with(ClassfileElement). If the element is to be dropped, no action is required.- Specified by:
acceptin interfaceClassfileTransform<CodeTransform,CodeElement, CodeBuilder> - Parameters:
cob- the builder for the new entitycoe- the element
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
mapFunction
Returns the value of themapFunctionrecord component.- Returns:
- the value of the
mapFunctionrecord component
-