Class TeamMeta

java.lang.Object
com.booksaw.betterTeams.team.meta.TeamMeta

public class TeamMeta extends Object
This class manages custom metaData for a team. It stores various properties as key-value pairs.
  • Constructor Details

    • TeamMeta

      public TeamMeta()
  • Method Details

    • set

      public void set(String key, String value)
      Adds or updates a metaData entry.
      Parameters:
      key - The identifier for the metaData.
      value - The string value of the metaData.
    • get

      public Optional<String> get(String key)
      Retrieves a metaData value by its key.
      Parameters:
      key - The key of the metaData to retrieve.
      Returns:
      An Optional containing the value, or empty if not found.
    • has

      public boolean has(String key)
      Checks if a metaData entry with the specified key exists.
      Parameters:
      key - The key to check.
      Returns:
      True if the metaData exists, false otherwise.
    • remove

      public void remove(String key)
      Removes a metaData entry by its key.
      Parameters:
      key - The key of the metaData to remove.
    • getAll

      public Map<String,String> getAll()
      Returns an unmodifiable view of all metaData entries.
      Returns:
      An unmodifiable Map of all metaData.
    • getSerialized

      public Map<String,String> getSerialized()
      Prepares the metadata for storage/serialization.
      Returns:
      A new Map<String, String> containing all metadata in a raw, serializable format.
    • load

      public void load(Map<String,String> rawMeta)
      Loads metaData from a raw map.
      Parameters:
      rawMeta - The map of raw metaData to load.