io.github.alshain01.flags.api.area
Interface Area

All Superinterfaces:
java.lang.Comparable<Area>
All Known Subinterfaces:
Administrator, Cuboid, Identifiable, Ownable, Renameable, Siegeable, Subdividable

public interface Area
extends java.lang.Comparable<Area>


Nested Class Summary
static class Area.AreaRelationship
           
 
Method Summary
 int compareNameTo(Area a)
          Returns an alphabetic comparison based on the area name.
 int compareTo(Area a)
          Returns an alphabetic comparison based on the area ID.
 java.lang.String getAbsoluteMessage(Flag flag)
          Gets the message associated with a player flag.
 java.lang.String getAbsoluteMessage(Flag flag, java.lang.String playerName)
          Gets the message associated with a player flag and parses {AreaType}, {AreaName}, {Owner}, {World}, and {Player}.
 java.util.Collection<org.bukkit.permissions.Permission> getAbsolutePermissionTrust(Flag flag)
          Gets a collection of trusted permissions not including those trusted in world defaults
 java.util.Collection<org.bukkit.OfflinePlayer> getAbsolutePlayerTrust(Flag flag)
          Gets a list of trusted players not including those trusted in world defaults
 java.lang.String getAbsoluteRawMessage(Flag flag)
          Gets the message associated with a player flag and returns it as-is.
 java.lang.Boolean getAbsoluteState(Flag flag)
          Gets the absolute state of the flag for this area.
 AreaPlugin getAreaPlugin()
          Gets the plugin that defines this area.
 java.lang.String getId()
          Gets the area plugin's ID for this area.
 java.lang.String getMessage(Flag flag)
          Gets the message associated with a player flag.
 java.lang.String getMessage(Flag flag, java.lang.String playerName)
          Gets the message associated with a player flag and parses {AreaType}, {AreaName}, {Owner}, {World}, and {Player}.
 java.lang.String getName()
          Returns the name of the area defined in the area plugin.
 java.util.Collection<org.bukkit.permissions.Permission> getPermissionTrust(Flag flag)
          Gets a collection of trusted permissions including those trusted in world defaults
 java.util.Collection<org.bukkit.OfflinePlayer> getPlayerTrust(Flag flag)
          Gets a list of trusted players including those trusted in the world defaults Wilderness and Default areas will be absolute with this method.
 java.lang.String getRawMessage(Flag flag)
          Gets the message associated with a player flag and returns it as-is.
 Area.AreaRelationship getRelationship(Area area)
          Returns the relationship of the provided area to the existing area This is true such that this is a (PARENT, CHILD, ETC.) of the provided area.
 boolean getState(Flag flag)
          Gets the state of the flag for this area or the default flag if not set.
 org.bukkit.World getWorld()
          Gets the world in which area resides.
 boolean hasBundlePermission(org.bukkit.permissions.Permissible permission)
          Checks the players permission to set bundles at this location
 boolean hasFlagPermission(org.bukkit.permissions.Permissible permission)
          Checks the players permission to set flags at this location.
 boolean hasTrust(Flag flag, org.bukkit.entity.Player player)
          Gets if the provided player is the area owner, has explicit trust, or has permission trust.
 boolean isArea()
          Validates the underlying object from the area plugin is not null.
 boolean removeTrust(Flag flag, org.bukkit.OfflinePlayer trustee, org.bukkit.command.CommandSender sender)
          Removes a player from the trust.
 boolean removeTrust(Flag flag, org.bukkit.permissions.Permission permission, org.bukkit.command.CommandSender sender)
          Removes a permission from the trust.
 boolean setMessage(Flag flag, java.lang.String message, org.bukkit.command.CommandSender sender)
          Sets or removes the message associated with a player flag.
 boolean setState(Flag flag, java.lang.Boolean state, org.bukkit.command.CommandSender sender)
          Sets the state of the flag for this area.
 boolean setTrust(Flag flag, org.bukkit.OfflinePlayer trustee, org.bukkit.command.CommandSender sender)
          Adds player to a the trust.
 boolean setTrust(Flag flag, org.bukkit.permissions.Permission permission, org.bukkit.command.CommandSender sender)
          Adds permission to a the trust.
 

Method Detail

getAreaPlugin

AreaPlugin getAreaPlugin()
Gets the plugin that defines this area.

Returns:
the plugin that defines this area.

isArea

boolean isArea()
Validates the underlying object from the area plugin is not null.

Returns:
true if the underlying area object is not null.

getId

java.lang.String getId()
Gets the area plugin's ID for this area.

Returns:
the area's ID in the format provided by the area plugin.
Throws:
InvalidAreaException

getName

java.lang.String getName()
Returns the name of the area defined in the area plugin. On very few systems this will return the id if name is unsupported. Depending on the system this has the potential to be null if not set.

Returns:
The name of the area
Throws:
InvalidAreaException

getWorld

org.bukkit.World getWorld()
Gets the world in which area resides.

Returns:
the world in which area resides.
Throws:
InvalidAreaException

getState

boolean getState(@Nonnull
                 Flag flag)
Gets the state of the flag for this area or the default flag if not set.

Parameters:
flag - The flag to retrieve the state for.
Returns:
The state of the flag defaults if not defined.

getAbsoluteState

java.lang.Boolean getAbsoluteState(@Nonnull
                                   Flag flag)
Gets the absolute state of the flag for this area.

Parameters:
flag - The flag to retrieve the state for.
Returns:
the state of the flag or null if not defined.

setState

boolean setState(@Nonnull
                 Flag flag,
                 @Nullable
                 java.lang.Boolean state,
                 @Nullable
                 org.bukkit.command.CommandSender sender)
Sets the state of the flag for this area.

Parameters:
flag - The flag to set the state for.
state - The state to set or null to remove.
sender - The command sender for event call and economy transactions. May be null if no associated player or console.
Returns:
false if the event was canceled.

getMessage

java.lang.String getMessage(@Nonnull
                            Flag flag)
Gets the message associated with a player flag. Translates the color codes and populates instances of {AreaType}, {Owner}, {AreaName}, and {World} This follows the Flag inheritance path

Parameters:
flag - The flag to retrieve the message for.
Returns:
the message associated with the flag.

getAbsoluteMessage

java.lang.String getAbsoluteMessage(@Nonnull
                                    Flag flag)
Gets the message associated with a player flag. Translates the color codes and populates instances of {AreaType}, {Owner}, {AreaName}, and {World}

Parameters:
flag - The flag to retrieve the message for.
Returns:
the message associated with the flag.

getMessage

java.lang.String getMessage(@Nonnull
                            Flag flag,
                            @Nonnull
                            java.lang.String playerName)
Gets the message associated with a player flag and parses {AreaType}, {AreaName}, {Owner}, {World}, and {Player}.

Parameters:
flag - The flag to retrieve the message for.
playerName - The player who's name will be inserted into the message.
Returns:
The message associated with the flag.

getAbsoluteMessage

java.lang.String getAbsoluteMessage(@Nonnull
                                    Flag flag,
                                    @Nonnull
                                    java.lang.String playerName)
Gets the message associated with a player flag and parses {AreaType}, {AreaName}, {Owner}, {World}, and {Player}.

Parameters:
flag - The flag to retrieve the message for.
playerName - The player who's name will be inserted into the message.
Returns:
The message associated with the flag.

getRawMessage

java.lang.String getRawMessage(@Nonnull
                               Flag flag)
Gets the message associated with a player flag and returns it as-is.

Parameters:
flag - The flag to retrieve the message for.
Returns:
The message associated with the flag.

getAbsoluteRawMessage

java.lang.String getAbsoluteRawMessage(@Nonnull
                                       Flag flag)
Gets the message associated with a player flag and returns it as-is.

Parameters:
flag - The flag to retrieve the message for.
Returns:
The message associated with the flag.

setMessage

boolean setMessage(@Nonnull
                   Flag flag,
                   @Nullable
                   java.lang.String message,
                   @Nullable
                   org.bukkit.command.CommandSender sender)
Sets or removes the message associated with a player flag.

Parameters:
flag - The flag to set the message for.
message - The message to set, null to remove.
sender - The command sender for event call and economy transactions. May be null if no associated player or console.
Returns:
true if successful

getPlayerTrust

java.util.Collection<org.bukkit.OfflinePlayer> getPlayerTrust(@Nonnull
                                                              Flag flag)
Gets a list of trusted players including those trusted in the world defaults Wilderness and Default areas will be absolute with this method.

Parameters:
flag - The flag to retrieve the trust list for.
Returns:
The list of players

getAbsolutePlayerTrust

java.util.Collection<org.bukkit.OfflinePlayer> getAbsolutePlayerTrust(@Nonnull
                                                                      Flag flag)
Gets a list of trusted players not including those trusted in world defaults

Parameters:
flag - The flag to retrieve the trust list for.
Returns:
The list of players

getPermissionTrust

java.util.Collection<org.bukkit.permissions.Permission> getPermissionTrust(@Nonnull
                                                                           Flag flag)
Gets a collection of trusted permissions including those trusted in world defaults

Parameters:
flag - The flag to retrieve the trust for.
Returns:
the collection of trusted permissions

getAbsolutePermissionTrust

java.util.Collection<org.bukkit.permissions.Permission> getAbsolutePermissionTrust(@Nonnull
                                                                                   Flag flag)
Gets a collection of trusted permissions not including those trusted in world defaults

Parameters:
flag - The flag to retrieve the trust for.
Returns:
the collection of trusted permissions

setTrust

boolean setTrust(@Nonnull
                 Flag flag,
                 @Nonnull
                 org.bukkit.OfflinePlayer trustee,
                 @Nullable
                 org.bukkit.command.CommandSender sender)
Adds player to a the trust.

Parameters:
flag - The flag to change trust for.
trustee - The player being trusted
sender - The command sender for event call and economy transactions. May be null if no associated player or console.
Returns:
true if successful.

setTrust

boolean setTrust(@Nonnull
                 Flag flag,
                 @Nonnull
                 org.bukkit.permissions.Permission permission,
                 @Nullable
                 org.bukkit.command.CommandSender sender)
Adds permission to a the trust.

Parameters:
flag - The flag to change trust for.
permission - The permission being trusted
sender - The command sender for event call and economy transactions. May be null if no associated player or console.
Returns:
true if successful.

removeTrust

boolean removeTrust(@Nonnull
                    Flag flag,
                    @Nonnull
                    org.bukkit.OfflinePlayer trustee,
                    @Nullable
                    org.bukkit.command.CommandSender sender)
Removes a player from the trust.

Parameters:
flag - The flag to change trust for.
trustee - The player being distrusted
sender - The command sender for event call and economy transactions. May be null if no associated player or console.
Returns:
true if successful.

removeTrust

boolean removeTrust(@Nonnull
                    Flag flag,
                    @Nonnull
                    org.bukkit.permissions.Permission permission,
                    @Nullable
                    org.bukkit.command.CommandSender sender)
Removes a permission from the trust.

Parameters:
flag - The flag to change trust for.
permission - The permission being distrusted
sender - The command sender for event call and economy transactions. May be null if no associated player or console.
Returns:
true if successful.

hasTrust

boolean hasTrust(@Nonnull
                 Flag flag,
                 @Nonnull
                 org.bukkit.entity.Player player)
Gets if the provided player is the area owner, has explicit trust, or has permission trust.

Parameters:
flag - The flag to check the trust for.
player - The player to check trust for.
Returns:
true if the player is trusted.

hasFlagPermission

boolean hasFlagPermission(@Nonnull
                          org.bukkit.permissions.Permissible permission)
Checks the players permission to set flags at this location.

Parameters:
permission - The player to check.
Returns:
true if the player has permissions.

hasBundlePermission

boolean hasBundlePermission(@Nonnull
                            org.bukkit.permissions.Permissible permission)
Checks the players permission to set bundles at this location

Parameters:
permission - The player to check.
Returns:
true if the player has permissions.

getRelationship

Area.AreaRelationship getRelationship(@Nonnull
                                      Area area)
Returns the relationship of the provided area to the existing area This is true such that this is a (PARENT, CHILD, ETC.) of the provided area.

Parameters:
area - the area to check the relationship.
Returns:
the relationship of the provided area to this one.

compareTo

int compareTo(@Nonnull
              Area a)
Returns an alphabetic comparison based on the area ID.

Specified by:
compareTo in interface java.lang.Comparable<Area>
Returns:
The value of the comparison.

compareNameTo

int compareNameTo(@Nonnull
                  Area a)
Returns an alphabetic comparison based on the area name.

Returns:
The value of the comparison.