Class Statistics

java.lang.Object
com.djrapitops.plan.extension.statistic.Statistics

public final class Statistics extends Object
Return value for StatisticsProvider.

Stores key-number statistical data similar to Minecraft statistics.

Statistics can be grouped together by placing a : in the key, for example group:key1, group:key2

Player statistics will be automatically summed up into server-wide statistics.

Requires Capability DATA_EXTENSION_STATISTICS_API.

  • Constructor Details

    • Statistics

      public Statistics()
  • Method Details

    • create

      public static Statistics create()
    • put

      public Statistics put(String key, Long value)
      Place statistic in the object.
      Parameters:
      key - String, with groups separated by :, e.g. "group_level_1:group_level_2:key"
      value - Statistical value.
      Returns:
      This object.
    • putAll

      public Statistics putAll(Map<String,Long> statistics)
      Place statistics in the object.
      Parameters:
      statistics - String-Long map, with groups separated by :, e.g. "group_level_1:group_level_2:key"
      Returns:
      This object.
      Throws:
      IllegalArgumentException - if map contains null keys or values.
    • getValueByKey

      public Map<String,Long> getValueByKey()
      The method Plan uses to get access to the data.
      Returns:
      Values stored in this object.
    • isEmpty

      public boolean isEmpty()