Record Class ClassRemapperImpl

java.lang.Object
java.lang.Record
org.glavo.classfile.impl.ClassRemapperImpl
All Implemented Interfaces:
ClassFileTransform<ClassTransform,ClassElement,ClassBuilder>, ClassTransform, ClassRemapper

public record ClassRemapperImpl(Function<ClassDesc,ClassDesc> mapFunction) extends Record implements ClassRemapper
  • Constructor Details

    • ClassRemapperImpl

      public ClassRemapperImpl(Function<ClassDesc,ClassDesc> mapFunction)
      Creates an instance of a ClassRemapperImpl record class.
      Parameters:
      mapFunction - the value for the mapFunction record component
  • Method Details

    • accept

      public void accept(ClassBuilder clb, ClassElement cle)
      Description copied from interface: ClassFileTransform
      Transform 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 to ClassFileBuilder.with(ClassFileElement). If the element is to be dropped, no action is required.
      Specified by:
      accept in interface ClassFileTransform<ClassTransform,ClassElement,ClassBuilder>
      Parameters:
      clb - the builder for the new entity
      cle - the element
    • asFieldTransform

      public FieldTransform asFieldTransform()
      Description copied from interface: ClassRemapper
      Returns this ClassRemapper as FieldTransform instance.
      Specified by:
      asFieldTransform in interface ClassRemapper
      Returns:
      this ClassRemapper as FieldTransform instance
    • asMethodTransform

      public MethodTransform asMethodTransform()
      Description copied from interface: ClassRemapper
      Returns this ClassRemapper as MethodTransform instance.
      Specified by:
      asMethodTransform in interface ClassRemapper
      Returns:
      this ClassRemapper as MethodTransform instance
    • asCodeTransform

      public CodeTransform asCodeTransform()
      Description copied from interface: ClassRemapper
      Returns this ClassRemapper as CodeTransform instance.
      Specified by:
      asCodeTransform in interface ClassRemapper
      Returns:
      this ClassRemapper as CodeTransform instance
    • map

      public ClassDesc map(ClassDesc desc)
      Description copied from interface: ClassRemapper
      Access method to internal class mapping function.
      Specified by:
      map in interface ClassRemapper
      Parameters:
      desc - source class
      Returns:
      target class
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • mapFunction

      public Function<ClassDesc,ClassDesc> mapFunction()
      Returns the value of the mapFunction record component.
      Returns:
      the value of the mapFunction record component