Class SetTeamComponent<T>

java.lang.Object
com.booksaw.betterTeams.team.SetTeamComponent<T>
All Implemented Interfaces:
TeamComponent<Set<T>>
Direct Known Subclasses:
LocationSetComponent, TeamPlayerSetComponent, UuidSetComponent, WarpSetComponent

public abstract class SetTeamComponent<T> extends Object implements TeamComponent<Set<T>>
  • Field Details

    • set

      protected final Set<T> set
  • Constructor Details

    • SetTeamComponent

      protected SetTeamComponent()
  • Method Details

    • get

      public Set<T> get()
      Specified by:
      get in interface TeamComponent<T>
      Returns:
      The stored value
    • getClone

      public Set<T> getClone()
      Used to get a clone of the stored list, this can be used to avoid concurrent modification
      Returns:
      A clone of the stored list
    • set

      public void set(Set<T> newSet)
      Specified by:
      set in interface TeamComponent<T>
      Parameters:
      newSet - Set what the currently stored value is
    • size

      public int size()
      Returns:
      The number of members stored within the list
    • isEmpty

      public boolean isEmpty()
      Returns:
      If the list is empty
    • load

      public void load(Iterable<String> strList)
    • getConvertedList

      public List<String> getConvertedList()
    • add

      public void add(Team team, T component)
      Used to add a component to this component list
      Parameters:
      team - the player's team
      component - The component to add
    • remove

      public void remove(Team team, T component)
      Used to remove a component from this component list
      Parameters:
      team - The playe's team
      component - The component to remove
    • contains

      public boolean contains(T component)
      Used to check if the component provided is stored within this component
      Parameters:
      component - The component to check
      Returns:
      If the component is within this component list
    • clear

      public void clear()
      Clears all values from the list.
    • getSectionHeading

      public abstract String getSectionHeading()
      Returns:
      The reference within the team storage where the data is stored
    • fromString

      public abstract T fromString(String str)
      Used to convert a string into the correct component for this type
      Parameters:
      str - The string to convert
      Returns:
      The value to be added to the list
    • toString

      public abstract String toString(T component)
      Used to convert a component of the list to a string for saving
      Parameters:
      component - The component to convert
      Returns:
      The converted component