Interface PlaceholderItem<T>

Type Parameters:
T - type of object needed to get data for placeholder.

public interface PlaceholderItem<T>
Represent single placeholder item, like "name" in player.name placeholder.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(T obj, Object[] args)
    Get data for this placeholder item as String or BaseComponent, like player.name should return here name of given player.
    Gets the full id of the item.
    Returns id/name of placeholder item, like that "name" in player.name.
    Returns type of placeholder item, like that "player" in player.name.
  • Method Details

    • getType

      PlaceholderType<T> getType()
      Returns type of placeholder item, like that "player" in player.name.
      Returns:
      type of placeholder.
    • getId

      String getId()
      Returns id/name of placeholder item, like that "name" in player.name.
      Returns:
      id of placeholder item.
    • apply

      Object apply(T obj, Object[] args)
      Get data for this placeholder item as String or BaseComponent, like player.name should return here name of given player.
      If method return other object than String or BaseComponent it will be changed to string by Object.toString() method.
      Parameters:
      obj - object to fetch the data needed for placeholder.
      args - arguments of item
      Returns:
      String of BaseComponent to use instead of placeholder.
    • getFullId

      String getFullId()
      Gets the full id of the item.
      Returns:
      String representing the full id.