Class PermissionCheckCallback.CheckResult

java.lang.Object
dev.polv.taleapi.event.player.PermissionCheckCallback.CheckResult
Enclosing interface:
PermissionCheckCallback

public static final class PermissionCheckCallback.CheckResult extends Object
Represents the result of a permission check callback.

Use the static factory methods to create instances:

  • Method Details

    • unmodified

      public static PermissionCheckCallback.CheckResult unmodified()
      Creates a result that keeps the original permission result.
      Returns:
      an unmodified check result
    • of

      Creates a result that wraps an existing permission result without modification.
      Parameters:
      result - the permission result to wrap
      Returns:
      a check result containing the given permission result
    • allow

      public static PermissionCheckCallback.CheckResult allow()
      Creates a result that overrides with ALLOW.
      Returns:
      an allow check result
    • allow

      public static PermissionCheckCallback.CheckResult allow(Object payload)
      Creates a result that overrides with ALLOW and a payload.
      Parameters:
      payload - the dynamic value
      Returns:
      an allow check result with payload
    • deny

      Creates a result that overrides with DENY.
      Returns:
      a deny check result
    • deny

      public static PermissionCheckCallback.CheckResult deny(Object payload)
      Creates a result that overrides with DENY and a payload.
      Parameters:
      payload - the dynamic value
      Returns:
      a deny check result with payload
    • override

      public static PermissionCheckCallback.CheckResult override(PermissionResult result)
      Creates a result that overrides with a custom permission result.
      Parameters:
      result - the permission result to use
      Returns:
      a modified check result
    • isModified

      public boolean isModified()
      Returns whether this result modifies the permission.
      Returns:
      true if the result was modified
    • getResult

      public PermissionResult getResult()
      Returns the permission result.
      Returns:
      the permission result (may be null if unmodified and no prior result)