Class SimplePermission

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class SimplePermission extends Permission

GSimplePermission is a trivial implementation of Permission that represents a permission that is either always or never allowed. The value is given at construction and doesn’t change.

Calling Permission.acquire(Cancellable) or Permission.release(Cancellable) on a GSimplePermission will result in errors.

  • Constructor Details

    • SimplePermission

      public SimplePermission(MemorySegment address)
      Create a SimplePermission instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • SimplePermission

      public SimplePermission(boolean allowed)
      Creates a new GPermission instance that represents an action that is either always or never allowed.
      Parameters:
      allowed - true if the action is allowed
      Since:
      2.26
    • SimplePermission

      public SimplePermission()
      Create a new SimplePermission.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the SimplePermission class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected SimplePermission asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Permission
      Returns:
      the instance as if it were its parent type
    • builder

      public static SimplePermission.Builder<? extends SimplePermission.Builder> builder()
      A SimplePermission.Builder object constructs a SimplePermission with the specified properties. Use the various set...() methods to set properties, and finish construction with SimplePermission.Builder.build().
      Returns:
      the builder object