Enum Class FieldAccess

java.lang.Object
java.lang.Enum<FieldAccess>
io.github.sugarcubes.cloner.FieldAccess
All Implemented Interfaces:
Serializable, Comparable<FieldAccess>, Constable

public enum FieldAccess extends Enum<FieldAccess>
Mechanisms reading and writing fields, see ToolsetBuilder.fieldAccess(FieldAccess...).
  • Enum Constant Details

    • REFLECTION

      public static final FieldAccess REFLECTION
      Reflection. Needs the package of the field opened to the cloner on JDK 9+ (or a ModuleOpening).
    • UNSAFE

      public static final FieldAccess UNSAFE
      Unsafe, works for any package. Since JDK 24 the JVM warns on the first use of sun.misc.Unsafe memory access; if it is denied (--sun-misc-unsafe-memory-access=deny), a toolset with this mechanism is not built.
    • VAR_HANDLE

      public static final FieldAccess VAR_HANDLE
      VarHandle of the trusted lookup, JDK 9+. Needs java.base/java.lang.invoke opened to the cloner.
    • NARCISSUS

      public static final FieldAccess NARCISSUS
      Narcissus library with its native part, must be on the classpath. Narcissus loads a native library: since JDK 24 the JVM warns about it unless started with --enable-native-access=ALL-UNNAMED (or the module of Narcissus), a future JDK will deny it.
  • Method Details

    • values

      public static FieldAccess[] 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

      public static FieldAccess valueOf(String name)
      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 name
      NullPointerException - if the argument is null