Improved documentation of Island#getMembers() and Island#getMemberSet()

This commit is contained in:
Florian CUNY 2019-04-08 20:38:50 +02:00
parent af2f600621
commit 246a6c30d0

View File

@ -89,10 +89,21 @@ public class Island implements DataObject {
private long updatedDate; private long updatedDate;
//// Team //// //// Team ////
/**
* Owner of the island.
* There can only be one per island.
* If it is {@code null}, then the island is considered as unowned.
*/
@Expose @Expose
@Nullable @Nullable
private UUID owner; private UUID owner;
/**
* Members of the island.
* It contains any player which has one of the following rank on this island: {@link RanksManager#COOP_RANK COOP},
* {@link RanksManager#TRUSTED_RANK TRUSTED}, {@link RanksManager#MEMBER_RANK MEMBER}, {@link RanksManager#SUB_OWNER_RANK SUB_OWNER},
* {@link RanksManager#OWNER_RANK OWNER}.
*/
@Expose @Expose
private Map<UUID, Integer> members = new HashMap<>(); private Map<UUID, Integer> members = new HashMap<>();
@ -234,16 +245,24 @@ public class Island implements DataObject {
} }
/** /**
* Get the team members of the island. If this is empty or cleared, there is no team. * Returns the members of this island.
* @return the members - key is the UUID, value is the RanksManager enum, e.g. RanksManager.MEMBER_RANK * It contains any player which has one of the following rank on this island: {@link RanksManager#COOP_RANK COOP},
* {@link RanksManager#TRUSTED_RANK TRUSTED}, {@link RanksManager#MEMBER_RANK MEMBER}, {@link RanksManager#SUB_OWNER_RANK SUB_OWNER},
* {@link RanksManager#OWNER_RANK OWNER}.
*
* @return the members - key is the UUID, value is the RanksManager enum, e.g. {@link RanksManager#MEMBER_RANK}.
* @see #getMemberSet()
*/ */
public Map<UUID, Integer> getMembers() { public Map<UUID, Integer> getMembers() {
return members; return members;
} }
/** /**
* Members >= MEMBER_RANK * Returns an immutable set containing the UUIDs of players that are truly members of this island.
* This includes any player which has one of the following rank on this island: {@link RanksManager#MEMBER_RANK MEMBER},
* {@link RanksManager#SUB_OWNER_RANK SUB_OWNER}, {@link RanksManager#OWNER_RANK OWNER}.
* @return the members of the island (owner included) * @return the members of the island (owner included)
* @see #getMembers()
*/ */
public ImmutableSet<UUID> getMemberSet(){ public ImmutableSet<UUID> getMemberSet(){
Builder<UUID> result = new ImmutableSet.Builder<>(); Builder<UUID> result = new ImmutableSet.Builder<>();