Interface Claim

All Superinterfaces:
ContextSource
All Known Subinterfaces:
Town

public interface Claim extends ContextSource
Represents a protected claim.
  • Method Details

    • getUniqueId

      UUID getUniqueId()
      Gets the UUID of claim.
      Returns:
      The UUID of this claim
    • getType

      default ClaimType getType()
      Gets the ClaimType of claim.
      Returns:
      The claim type
    • getWorldUniqueId

      default UUID getWorldUniqueId()
      Gets the claim's world UUID.
      Returns:
      The world UUID
    • getWorldName

      String getWorldName()
      Gets the claim's world name.
      Returns:
      The world name
    • getDisplayNameComponent

      Optional<net.kyori.adventure.text.Component> getDisplayNameComponent()
      Gets the claim's display name Component.
      Returns:
      The display name component, if available
    • getDisplayName

      @Nullable String getDisplayName()
      Gets the claim's display name.
      Returns:
      The display name, if available
    • getFriendlyIdentifier

      @Nullable String getFriendlyIdentifier()
      Gets the unique friendly identifier of claim. Note: This represents the unique friendly identifier of claim and is different from the getDisplayName().
      Returns:
      The unique friendly identifier, if available
    • getClaimGroup

      @Nullable ClaimGroup getClaimGroup()
      Gets the claim group this claim is associated with.
      Returns:
      The claim group, if available
    • setFriendlyIdentifier

      void setFriendlyIdentifier(String name)
      Sets the unique friendly identifier of claim. Note: This represents the unique friendly identifier of claim and is different from the
      invalid reference
      #setDisplayName(Component)
      .
      Parameters:
      name - The unique friendly identifier
      replace - Whether to replace if identifier exists
    • getClaimVisual

      @Nullable ClaimVisual getClaimVisual()
      Gets the active ClaimVisual.
      Returns:
      The claim visual, if available
    • getOwnerName

      String getOwnerName()
      Gets the claim owner's name. Note:
      invalid reference
      ClaimType#ADMIN
      and
      invalid reference
      ClaimType#WILDERNESS
      claims do not have owners. These claims should return a general name such as 'administrator'.
      Returns:
      The name of claim owner
    • getOwnerDisplayName

      net.kyori.adventure.text.Component getOwnerDisplayName()
      Gets the claim owner's display name as a Component. Note:
      invalid reference
      ClaimType#ADMIN
      and
      invalid reference
      ClaimType#WILDERNESS
      claims do not have owners. These claims should return a general name such as 'administrator'.
      Returns:
      The display name of claim owner, if available
    • getOwnerUniqueId

      default UUID getOwnerUniqueId()
      Gets the claim owner's UUID. Note:
      invalid reference
      ClaimType#ADMIN
      and
      invalid reference
      ClaimType#WILDERNESS
      claims do not have owners.
      Returns:
      The UUID of this claim
    • addAttribute

      void addAttribute(ClaimAttribute attribute)
      Parameters:
      attribute - The claim attribute
    • removeAttribute

      default void removeAttribute(ClaimAttribute attribute)
      Removes a ClaimAttribute.
      Parameters:
      id - The claim attribute
    • removeAttribute

      void removeAttribute(String id)
      Removes a ClaimAttribute by id.
      Parameters:
      id - The claim attribute id
    • removeAllAttributes

      void removeAllAttributes()
      Removes all attribute types associated with claim.
    • hasAttribute

      default boolean hasAttribute(ClaimAttribute attribute)
      Checks if claim contains ClaimAttribute.
      Parameters:
      attribute - The claim attribute
      Returns:
      true if claim contains it, false if not
    • hasAttribute

      boolean hasAttribute(String id)
      Checks if claim contains ClaimAttribute by id.
      Parameters:
      id - The claim attribute id
      Returns:
      true if claim contains it, false if not
    • getAttributes

      Set<ClaimAttribute> getAttributes()
      Gets a set of ClaimAttribute's associated with claim.
      Returns:
      An unmodifiable set of claim attributes
    • getParent

      @Nullable Claim getParent()
      Gets the claim's parent.
      Returns:
      The parent claim, if available
    • getInheritedParents

      List<Claim> getInheritedParents()
    • getLesserBoundaryCorner

      com.flowpowered.math.vector.Vector3i getLesserBoundaryCorner()
      Gets the lesser boundary corner of claim.
      Returns:
      The lesser boundary corner location.
    • getGreaterBoundaryCorner

      com.flowpowered.math.vector.Vector3i getGreaterBoundaryCorner()
      Gets the greater boundary corner of claim.
      Returns:
      The greater boundary corner location.
    • isCuboid

      boolean isCuboid()
      Gets whether claim is a cuboid.
      Returns:
      true if claim is cuboid
    • isParent

      boolean isParent(Claim claim)
      Checks if claim is parent
      Parameters:
      claim - The claim to check
      Returns:
      true if claim is parent
    • getClaimBlocks

      int getClaimBlocks()
      Gets the claim blocks required for this claim. Note: If cuboids are enabled in wilderness, 2D claims will factor in Y.
      Returns:
      The claim blocks of claim
    • getArea

      int getArea()
      Gets the total claim area in blocks.
      Returns:
      The total area of claim
    • getVolume

      int getVolume()
      Gets the total claim volume in blocks.
      Returns:
      The total volume of claim
    • getWidth

      int getWidth()
      Gets the claim's width(x axis) in blocks.
      Returns:
      The width of claim
    • getHeight

      int getHeight()
      Gets the claim's height(y axis) in blocks.
      Returns:
      The height of claim
    • getLength

      int getLength()
      Gets the claim's length(z axis) in blocks.
      Returns:
      The length of claim
    • getChunkPositions

      List<com.flowpowered.math.vector.Vector3i> getChunkPositions()
      Gets the list of chunk positions used by this claim.
      Returns:
      The list of claim chunk positions used.
    • getPlayers

      List<UUID> getPlayers()
      Gets the list of players currently in claim.
      Returns:
      The list of players in claim.
    • transferOwner

      ClaimResult transferOwner(UUID ownerUniqueId)
      Transfers claim to new owner. Note: Both
      invalid reference
      ClaimType#WILDERNESS
      and
      invalid reference
      ClaimType#ADMIN
      cannot be transferred. This validates if the new owner has enough claim blocks to support this claim.
      Parameters:
      ownerUniqueId -
      Returns:
      The claim result
    • changeType

      default ClaimResult changeType(ClaimType type)
      Attempts to change claim to another type. Note: If changing an
      invalid reference
      ClaimType#ADMIN
      claim, owner is required.
      Parameters:
      type - The new claim type
      Returns:
      The claim result
    • changeType

      ClaimResult changeType(ClaimType type, @Nullable UUID owner)
      Attempts to change claim to another type and owner. Note:
      invalid reference
      ClaimType#WILDERNESS
      cannot be changed. If changing an
      invalid reference
      ClaimType#ADMIN
      claim, owner is required.
      Parameters:
      type - The new claim type
      owner - The owner to set
      Returns:
      The claim result
    • resize

      default ClaimResult resize(com.flowpowered.math.vector.Vector3i startCornerPos, com.flowpowered.math.vector.Vector3i endCornerPos)
      Resizes a claim.
      Parameters:
      startCornerPos - The start corner block position
      endCornerPos - The end corner block position
      Returns:
      The claim result
    • resize

      ClaimResult resize(int x1, int x2, int y1, int y2, int z1, int z2)
      Resizes the claim.
      Parameters:
      x1 - The start X-axis position
      x2 - The end X-axis position
      y1 - The start Y-axis position
      y2 - The end Y-axis position
      z1 - The start Z-axis position
      z2 - The end Z-axis position
      Returns:
      The claim result
    • getChildren

      Set<Claim> getChildren(boolean recursive)
      Gets an immutable list of child claims. Note: This will return an empty list if no child claims are found.
      Parameters:
      recursive - Whether to recursively scan for children
      Returns:
      The immutable list of child claims
    • getParents

      List<Claim> getParents(boolean recursive)
      Gets an immutable list of parent claims. Note: This will return an empty list if no parent claims are found.
      Parameters:
      recursive - Whether to recursively scan for parents
      Returns:
      The immutable list of parent claims
    • getUserTrusts

      Set<UUID> getUserTrusts()
      Gets an unmodifiable set of all trusted users.
      Returns:
      An unmodifiable set of all trusted users
    • getUserTrusts

      Set<UUID> getUserTrusts(TrustType type)
      Gets an unmodifiable set of trusted users for TrustType.
      Returns:
      An unmodifiable set of trusted users
    • getGroupTrusts

      Set<String> getGroupTrusts()
      Gets an unmodifiable set of all trusted groups.
      Returns:
      An unmodifiable set of all trusted groups
    • getGroupTrusts

      Set<String> getGroupTrusts(TrustType type)
      Gets an unmodifiable set of trusted groups for TrustType.
      Returns:
      An unmodifiable set of trusted groups
    • removeAllTrusts

      ClaimResult removeAllTrusts()
      Clears all trusts for claim.
      Returns:
      The claim result
    • removeAllUserTrusts

      ClaimResult removeAllUserTrusts()
      Clears all user trusts for claim.
      Returns:
      The claim result
    • removeAllGroupTrusts

      ClaimResult removeAllGroupTrusts()
      Clears all group trusts for claim.
      Returns:
      The claim result
    • getClanTrusts

      Set<Clan> getClanTrusts()
      Gets an unmodifiable set of all trusted clans.
      Returns:
      An unmodifiable set of all trusted clans
    • getClanTrusts

      Set<Clan> getClanTrusts(TrustType type)
      Gets an unmodifiable set of trusted clans for TrustType.
      Returns:
      An unmodifiable set of trusted clans
    • removeAllClanTrusts

      ClaimResult removeAllClanTrusts()
      Clears all clan trusts for claim.
      Returns:
      The claim result
    • addUserTrust

      ClaimResult addUserTrust(UUID uuid, TrustType type)
      Grants claim trust to the UUID for given TrustType.
      Parameters:
      uuid - The UUID of user
      type - The trust type
      Returns:
      The claim result
    • addUserTrusts

      ClaimResult addUserTrusts(Set<UUID> uuid, TrustType type)
      Grants claim trust to the set of UUID's for given TrustType.
      Parameters:
      uuid - The set of user UUID's
      type - The trust type
      Returns:
      The claim result
    • removeUserTrust

      ClaimResult removeUserTrust(UUID uuid, TrustType type)
      Removes UUID from claim trust for given TrustType.
      Parameters:
      uuid - The UUID of user
      type - The trust type
      Returns:
      The claim result
    • removeUserTrusts

      ClaimResult removeUserTrusts(Set<UUID> uuid, TrustType type)
      Removes the set of UUID's from claim trust for given TrustType.
      Parameters:
      uuid - The set of user UUID's
      type - The trust type
      Returns:
      The claim result
    • addGroupTrust

      ClaimResult addGroupTrust(String group, TrustType type)
      Grants claim trust to the group for given TrustType.
      Parameters:
      group - The group
      type - The trust type
      Returns:
      The claim result
    • addGroupTrusts

      ClaimResult addGroupTrusts(Set<String> groups, TrustType type)
      Grants claim trust to the set of groups for given TrustType.
      Parameters:
      groups - The set of groups
      type - The trust type
      Returns:
      The claim result
    • removeGroupTrust

      ClaimResult removeGroupTrust(String group, TrustType type)
      Removes a group from claim trust for given TrustType.
      Parameters:
      group - The group
      type - The trust type
      Returns:
      The claim result
    • removeGroupTrusts

      ClaimResult removeGroupTrusts(Set<String> groups, TrustType type)
      Removes the set of UUID's from claim trust for given TrustType.
      Parameters:
      groups - The set of groups
      type - The trust type
      Returns:
      The claim result
    • addClanTrust

      ClaimResult addClanTrust(Clan clan, TrustType type)
      Grants claim trust to the clan for given TrustType.
      Parameters:
      clan - The clan
      type - The trust type
      Returns:
      The claim result
    • addClanTrusts

      ClaimResult addClanTrusts(Set<Clan> clans, TrustType type)
      Grants claim trust to the set of clans for given TrustType.
      Parameters:
      clans - The set of clans
      type - The trust type
      Returns:
      The claim result
    • addClanTrust

      ClaimResult addClanTrust(String clanTag, TrustType type)
      Grants claim trust to the clan for given TrustType.
      Parameters:
      clanTag - The clan tag
      type - The trust type
      Returns:
      The claim result
    • removeClanTrust

      ClaimResult removeClanTrust(Clan clan, TrustType type)
      Removes a clan from claim trust for given TrustType.
      Parameters:
      clan - The clan
      type - The trust type
      Returns:
      The claim result
    • removeClanTrust

      ClaimResult removeClanTrust(String clanTag, TrustType type)
      Removes a clan from claim trust for given TrustType.
      Parameters:
      clanTag - The clan tag
      type - The trust type
      Returns:
      The claim result
    • removeClanTrusts

      ClaimResult removeClanTrusts(Set<Clan> clans, TrustType type)
      Removes the set of clans from claim trust for given TrustType.
      Parameters:
      clans - The set of clans
      type - The trust type
      Returns:
      The claim result
    • isUserTrusted

      boolean isUserTrusted(UUID uuid, TrustType type)
      Checks if the UUID is trusted with given TrustType.
      Parameters:
      uuid - The uuid to check
      type - The minimum trust required
      Returns:
      Whether the uuid is trusted
    • isGroupTrusted

      boolean isGroupTrusted(String group, TrustType type)
      Checks if the group is trusted with given TrustType.
      Parameters:
      group - The group to check
      type - The minimum trust required
      Returns:
      Whether the group is trusted
    • isClanTrusted

      boolean isClanTrusted(Clan clan, TrustType type)
      Checks if the clan is trusted with given TrustType.
      Parameters:
      clan - The clan to check
      type - The minimum trust required
      Returns:
      Whether the clan is trusted
    • isClanTrusted

      boolean isClanTrusted(String clanTag, TrustType type)
      Checks if the clan tag is trusted with given TrustType.
      Parameters:
      clanTag - The clan tag to check
      type - The minimum trust required
      Returns:
      Whether the clan is trusted
    • isAdminClaim

      default boolean isAdminClaim()
      Checks if this type is ClaimTypes.ADMIN.
      Returns:
      true if admin claim
    • isBasicClaim

      default boolean isBasicClaim()
      Checks if this type is ClaimTypes.BASIC.
      Returns:
      true if basic claim
    • isPlot

      default boolean isPlot()
      Checks if this type is ClaimTypes.PLOT.
      Returns:
      true if plot
    • isSubdivision

      default boolean isSubdivision()
      Checks if this type is ClaimTypes.SUBDIVISION.
      Returns:
      true if subdivision
    • isTown

      default boolean isTown()
      Checks if this type is ClaimTypes.TOWN.
      Returns:
      true if town
    • isWilderness

      default boolean isWilderness()
      Checks if this type is ClaimTypes.WILDERNESS.
      Returns:
      true if wilderness
    • isInTown

      boolean isInTown()
      Checks if this claim is within a town.
      Returns:
      true if this claim is within a town
    • getTown

      @Nullable Claim getTown()
      Gets the town this claim is in.
      Returns:
      the town this claim is in, if any
    • getClaimManager

      ClaimManager getClaimManager()
      Gets the ClaimManager of this claim's world.
      Returns:
      The claim manager
    • getWilderness

      Claim getWilderness()
      Gets the wilderness claim of this claim's world.
      Returns:
      The wilderness claim
    • contains

      default boolean contains(int x, int y, int z)
      Checks if the position is within this claim.
      Parameters:
      x - X coordinate
      y - Y coordinate
      z - Z coordinate
      Returns:
      Whether this claim contains the passed position
    • contains

      default boolean contains(com.flowpowered.math.vector.Vector3i pos)
      Checks if the position is within this claim.
      Parameters:
      location -
      Returns:
      Whether this claim contains the passed position
    • contains

      default boolean contains(com.flowpowered.math.vector.Vector3i pos, boolean excludeChildren)
      Checks if the position is within this claim.
      Parameters:
      excludeChildren -
      location -
      Returns:
      Whether this claim contains the passed location
    • contains

      boolean contains(int x, int y, int z, boolean excludeChildren)
      Checks if the position is within this claim.
      Parameters:
      x - X coordinate
      y - Y coordinate
      z - Z coordinate
      excludeChildren -
      Returns:
      Whether this claim contains the passed location
    • overlaps

      boolean overlaps(Claim otherClaim)
      Checks if this claim overlaps another.
      Parameters:
      otherClaim - The other claim to check
      Returns:
      Whether this claim overlaps the other claim
    • extend

      boolean extend(int newDepth)
      Extends a cuboid claim downward.
      Parameters:
      newDepth - The new depth
      Returns:
      Whether the extension was successful
    • isInside

      boolean isInside(Claim otherClaim)
      Checks if this claim is within another claim.
      Parameters:
      otherClaim - The other claim
      Returns:
      Whether this claim is inside other claim
    • getChunkHashes

      Set<Long> getChunkHashes()
      Gets the chunk hashes this claim contains.
      Returns:
      The set of chunk hashes
    • deleteChildren

      ClaimResult deleteChildren()
      Deletes all children claims.
      Returns:
      The result of deletion
    • deleteChildren

      ClaimResult deleteChildren(ClaimType type)
      Deletes all children claims of a specific ClaimType.
      Parameters:
      type - The type of claims to delete
      Returns:
      The result of deletion
    • deleteChild

      ClaimResult deleteChild(Claim child)
      Deletes a child claim.
      Parameters:
      child - The child claim to be deleted
      Returns:
      The result of deletion
    • getData

      ClaimData getData()
      Gets the persisted data of claim.
      Returns:
      The claim's persisted data
    • deleteSchematic

      boolean deleteSchematic(String schematic)
      Deletes the specified ClaimSchematic if it exists.
      Parameters:
      name - The schematic to delete
      Returns:
      true if the schematic was deleted
    • getSchematics

      Map<String,ClaimSchematic> getSchematics()
      Gets a map of currently stored ClaimSchematic's.
      Returns:
      The map of schematics, empty if none
    • createSnapshot

      ClaimSnapshot createSnapshot(String name, net.kyori.adventure.text.Component description, SnapshotCreateSettings settings)
      Creates a ClaimSnapshot.
      Parameters:
      name - The snapshot name
      description - The snapshot description
      settings - The creation settings
      Returns:
      The claim snapshot
    • createSnapshot

      ClaimSnapshot createSnapshot(String name, boolean includeChildren)
      Creates a ClaimSnapshot. Note: This will use default SnapshotCreateSettings
      Parameters:
      name - The snapshot name
      includeChildren - True to include children, false if not
      Returns:
      The claim snapshot
    • createSnapshot

      ClaimSnapshot createSnapshot(String name, net.kyori.adventure.text.Component description, boolean includeChildren)
      Creates a ClaimSnapshot. Note: This will use default SnapshotCreateSettings
      Parameters:
      name - The snapshot name
      description - The snapshot description
      includeChildren - True to include children, false if not
      Returns:
      The claim snapshot
    • deleteSnapshot

      boolean deleteSnapshot(String name)
      Deletes the specified ClaimSnapshot if it exists.
      Parameters:
      name - The snapshot to delete
      Returns:
      true if the snapshot was deleted
    • getSnapshots

      Map<String,ClaimSnapshot> getSnapshots()
      Gets a map of currently stored ClaimSnapshot's.
      Returns:
      The map of snapshots, empty if none
    • getEconomyData

      default EconomyData getEconomyData()
    • getEconomyAccountId

      @Nullable UUID getEconomyAccountId()
      Gets the economy account used for claim bank.
      Returns:
      the economy account, if available
    • getRentedClaim

      @Nullable Claim getRentedClaim()
      Gets the rented claim. Note: If this is a non-rented child claim, it will check parents that have same owner.
      Returns:
      The rented claim
    • hasActiveVisual

      boolean hasActiveVisual(User user)
      Whether the User has an active visual on this Claim.
      Parameters:
      user - The user
      Returns:
      true if active visual, false if not
    • isPvpAllowed

      boolean isPvpAllowed()
      Whether PVP is allowed in this Claim.
      Returns:
      true if allowed, false if not
    • allowEdit

      boolean allowEdit(UUID uuid)
      Whether user with UUID can edit claim.
      Parameters:
      uuid - The user unique id
      Returns:
      true if allowed, false if not
    • canBreak

      boolean canBreak(Object source, Object location, @Nullable User user)
      Checks if a block can be broken at specified location in this Claim.
      Note: If source was performed directly by player, pass player
      Note: If source is custom, pass a string identifier in format 'modid:name'
      Parameters:
      source - The source performing the break action
      location - The target block location
      user - The user associated with action, if available
      Returns:
      true if block can be broken, false if not
    • canPlace

      boolean canPlace(Object source, Object placedItem, Object location, @Nullable User user)
      Checks if a block can be placed at specified location in this Claim.
      Note: If source was performed directly by player, pass player
      Note: If source or item is custom, pass a string identifier in format 'modid:name'
      Parameters:
      source - The source performing the place action
      placedItem - The item being placed
      location - The target block location
      user - The user associated with action, if available
      Returns:
      true if block can be placed, false if not
    • canHurtEntity

      boolean canHurtEntity(Object source, Object itemStack, Object entity, @Nullable User user)
      Checks if an entity can be attacked in this Claim.
      Note: If source was performed directly by player, pass player
      Note: If source or item is custom, pass a string identifier in format 'modid:name'
      Parameters:
      source - The source performing the attack
      itemStack - The item being used to attack entity
      entity - The target entity
      user - The user associated with action, if available
      Returns:
      true if entity can be attacked, false if not
    • canInteractWithEntity

      boolean canInteractWithEntity(Object source, Object itemStack, Object entity, @Nullable User user, TrustType trustType)
      Checks if an entity can be interacted with in this Claim.
      Note: If source was performed directly by player, pass player
      Note: If source, item, or entity is custom, pass a string identifier in format 'modid:name'
      Parameters:
      source - The source performing the entity interaction
      itemStack - The item being used to interact with entity
      entity - The target entity
      user - The user associated with action, if available
      trustType - The minimum TrustType required
      Returns:
      true if entity can be interacted with, false if not
    • canUseBlock

      default boolean canUseBlock(Object source, Object location, @Nullable User user, TrustType trustType)
      Checks if a block can be used at specified location.
      Note: If source was performed directly by player, pass player
      Note: If source is custom, pass a string identifier in format 'modid:name'
      Parameters:
      source - The source performing the use action
      location - The target block location
      user - The user associated with action, if available
      trustType - The minimum TrustType required
      Returns:
      true if block can be used, false if not
    • canUseBlock

      boolean canUseBlock(Object source, Object location, @Nullable User user, TrustType trustType, boolean leftClick, boolean shift)
      Checks if a block can be used at specified location.
      Note: If source was performed directly by player, pass player
      Note: If source is custom, pass a string identifier in format 'modid:name'
      Note: Parameters 'leftClick' and 'shift' are only used if player is source.
      Parameters:
      source - The source performing the use action
      location - The target block location
      user - The user associated with action, if available
      trustType - The minimum TrustType required
      leftClick - If block will be activated on left-click
      shift - If block activation requires shift
      Returns:
      true if block can be used, false if not
    • canUseItem

      default boolean canUseItem(Object source, Object itemStack, Object location, @Nullable User user, TrustType trustType)
      Checks if this player can use item at a specified location.
      Note: If source was performed directly by player, pass player
      Note: If source or item is custom, pass a string identifier in format 'modid:name'
      Note: If item is activated on right-click then 'leftClick' should be false.
      Parameters:
      source - The source performing the use action
      itemStack - The target itemStack
      location - The location where item will be used
      user - The user associated with action, if available
      trustType - The minimum TrustType required
      Returns:
      true if player can use item, false if not
    • canUseItem

      boolean canUseItem(Object source, Object itemStack, Object location, @Nullable User user, TrustType trustType, boolean leftClick, boolean shift)
      Checks if this player can use item at a specified location.
      Note: If source was performed directly by player, pass player
      Note: If source or item is custom, pass a string identifier in format 'modid:name'
      Note: If item is activated on right-click then 'leftClick' should be false.
      Parameters:
      source - The source performing the use action
      itemStack - The target itemStack
      location - The location where item will be used
      user - The user associated with action, if available
      trustType - The minimum TrustType required
      leftClick - If item will be activated on left-click
      shift - If item activation requires shift.
      Returns:
      true if player can use item, false if not
    • getActiveFlagPermissionValue

      default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts)
      Gets the active Flag permission value for Subject in this Claim.
      Parameters:
      flag - The flag
      subject - The subject
      contexts - The contexts
      Returns:
      The active flag value
    • getActiveFlagPermissionValue

      default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts, TrustType type)
      Gets the active Flag permission value for Subject in this Claim.
      Parameters:
      flag - The flag
      subject - The subject
      contexts - The contexts
      type - The trust type
      Returns:
      The active flag value
    • getActiveFlagPermissionValue

      default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts, boolean checkOverride)
      Gets the active Flag permission value for Subject in this Claim.
      Parameters:
      flag - The flag
      subject - The subject
      contexts - The contexts
      checkOverride - Whether to check override
      Returns:
      The active flag value
    • getActiveFlagPermissionValue

      default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts, TrustType type, boolean checkOverride)
      Gets the active Flag permission value for Subject in this Claim.
      Parameters:
      flag - The flag
      subject - The subject
      contexts - The contexts
      type - The trust type
      checkOverride - Whether to check override
      Returns:
      The active flag value
    • getActiveFlagPermissionValue

      default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Object source, Object target, Set<Context> contexts)
      Gets the active Flag permission value for Subject in this Claim.
      Parameters:
      flag - The flag
      subject - The subject
      source - The source
      target - The target
      contexts - The contexts
      Returns:
      The active flag value
    • getActiveFlagPermissionValue

      default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Object source, Object target, Set<Context> contexts, boolean checkOverride)
      Gets the active Flag permission value for Subject in this Claim.
      Parameters:
      flag - The flag
      subject - The subject
      source - The source
      target - The target
      contexts - The contexts
      checkOverride - Whether to check override
      Returns:
      The active flag value
    • getActiveFlagPermissionValue

      default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Object source, Object target, Set<Context> contexts, TrustType type, boolean checkOverride)
      Gets the active Flag permission value for Subject in this Claim.
      Parameters:
      flag - The flag
      subject - The subject
      source - The source
      target - The target
      contexts - The contexts
      type - The trust type
      checkOverride - Whether to check override
      Returns:
      The active flag value
    • getFlagPermissionValue

      default Tristate getFlagPermissionValue(Flag flag, Set<Context> contexts)
      Gets the Flag permission value with Context's. Note: This uses the default subject which applies to all users in claim.
      Parameters:
      flag - The claim flag
      contexts - The claim contexts
      target - The target id
      Returns:
      The permission value, or Tristate.UNDEFINED if none
    • setFlagPermission

      default CompletableFuture<PermissionResult> setFlagPermission(Flag flag, Tristate value, Set<Context> contexts)
      Sets Flag permission with Context's. Note: This uses the default subject which applies to all users in claim.
      Parameters:
      flag - The claim flag
      value - The new value
      contexts - The claim contexts
      Returns:
      The permission result future
    • setFlagPermission

      default CompletableFuture<PermissionResult> setFlagPermission(Flag flag, Subject subject, Tristate value, Set<Context> contexts)
      Sets Flag permission on Subject with Context's.
      Parameters:
      flag - The claim flag
      subject - The subject
      value - The new value
      contexts - The claim contexts
      Returns:
      The permission result future
    • setFlagDefinition

      default CompletableFuture<PermissionResult> setFlagDefinition(FlagDefinition definition, Tristate value)
      Set FlagDefinition in this Claim.
      Parameters:
      definition - The flag definition
      value - The new value
      Returns:
      The permission result future
    • setFlagDefinition

      CompletableFuture<PermissionResult> setFlagDefinition(Subject subject, FlagDefinition definition, Tristate value)
      Set FlagDefinition on Subject in this Claim.
      Parameters:
      subject - The subject
      definition - The flag definition
      value - The new value
      Returns:
      The permission result future
    • setOptionDefinition

      default CompletableFuture<PermissionResult> setOptionDefinition(OptionDefinition definition, String value)
      Set OptionDefinition in this Claim.
      Parameters:
      definition - The option definition
      value - The new value
      Returns:
      The permission result future
    • setOptionDefinition

      CompletableFuture<PermissionResult> setOptionDefinition(Subject subject, OptionDefinition definition, String value)
      Parameters:
      subject - The subject
      definition - The option definition
      value - The new value
      Returns:
      The permission result future
    • getActiveOptionValue

      default <T> T getActiveOptionValue(io.leangen.geantyref.TypeToken<T> type, Option<T> option, Set<Context> contexts)
      Gets the active Option value with Context's in this Claim.
      Parameters:
      type - The option type
      option - The option
      contexts - The contexts
      claim - The claim
      Returns:
      The active option value
    • getActiveOptionValue

      default <T> T getActiveOptionValue(io.leangen.geantyref.TypeToken<T> type, Option<T> option, Subject subject, Set<Context> contexts)
      Gets the active Option value for with Context's in this Claim.
      Parameters:
      type - The option type
      option - The option
      subject - The subject
      contexts - The contexts
      claim - The claim
      Returns:
      The active option value
    • getOptionValue

      default String getOptionValue(Option<?> option, Set<Context> contexts)
      Gets the Option value with Context's in this Claim.
      Parameters:
      option - The option
      contexts - The contexts
      claim - The claim
      Returns:
      The option value
    • getOptionValue

      String getOptionValue(Option<?> option, Subject subject, Set<Context> contexts)
      Gets the Option value with Context's in this Claim.
      Parameters:
      option - The option
      subject - The subject
      contexts - The contexts
      claim - The claim
      Returns:
      The option value
    • getActiveOptionDefinitionValue

      default String getActiveOptionDefinitionValue(OptionDefinition definition)
      Gets the active OptionDefinition value in this Claim.
      Parameters:
      definition - The option definition
      Returns:
      The active value
    • getActiveOptionDefinitionValue

      String getActiveOptionDefinitionValue(Subject subject, OptionDefinition definition)
      Gets the active OptionDefinition value in this Claim.
      Parameters:
      definition - The option definition
      Returns:
      The active value
    • setOption

      default CompletableFuture<PermissionResult> setOption(Option option, String value, Set<Context> contexts)
      Sets Option value with Context's. Note: This uses the default subject which applies to all users in claim.
      Parameters:
      option - The option
      value - The new value
      contexts - The claim contexts
      Returns:
      The permission result future
    • setOption

      default CompletableFuture<PermissionResult> setOption(Option option, Subject subject, String value, Set<Context> contexts)
      Sets Option value on Subject with Context's.
      Parameters:
      option - The option
      subject - The subject
      value - The new value
      contexts - The claim contexts
      Returns:
      The permission result future
    • getDefaultTypeContext

      Context getDefaultTypeContext()
      Gets the default context which is used for storing flag defaults.
      Returns:
      The default context
    • getOverrideTypeContext

      Context getOverrideTypeContext()
      Gets the override context which is used for overriding claim flags.
      Returns:
      The override context
    • builder

      static Claim.Builder builder()
      Gets a new claim builder instance for Claim.Builder.
      Returns:
      A new claim builder instance