Enum Class PlaceholderType

java.lang.Object
java.lang.Enum<PlaceholderType>
me.remigio07.chatplugin.api.server.util.PlaceholderType
All Implemented Interfaces:
Serializable, Comparable<PlaceholderType>, Constable

public enum PlaceholderType extends Enum<PlaceholderType>
Represents all ChatPlugin's integrated placeholders plus PlaceholderAPI and MVdWPlaceholderAPI extensions.
See Also:
  • Enum Constant Details

    • JUST_NAME

      public static final PlaceholderType JUST_NAME
      Will translate only the {player} placeholder.
    • PLAYER

      public static final PlaceholderType PLAYER
      Represents player-related placeholders.
    • SERVER

      public static final PlaceholderType SERVER
      Represents server-side placeholders.
    • INTEGRATIONS

      public static final PlaceholderType INTEGRATIONS
      Represents integrations' placeholders (includes also PlaceholderAPI's and MVdWPlaceholderAPI's).
  • Method Details

    • values

      public static PlaceholderType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PlaceholderType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPlaceholders

      public String[] getPlaceholders()
      Gets the list of available placeholders for this placeholder type.

      Note: if this == INTEGRATIONS an array with just the integrated placeholders will be returned, even if this includes all the placeholders from PlaceholderAPI and MVdWPlaceholderAPI.

      Returns:
      Array of available placeholders
    • getPlaceholder

      public static PlaceholderType getPlaceholder(String input)
      Gets a placeholder type from an input String.

      The input should be equals (ignoring case) to one of this enum's constants. If not, null will be returned.

      Parameters:
      input - Enum.name(), ignoring case
      Returns:
      Requested placeholder type or null if the input is invalid
    • getPlaceholders

      public static List<PlaceholderType> getPlaceholders(List<String> input)
      Gets a placeholder types list from an input String list.
      Parameters:
      input - Input list containing Enum.name()s, ignoring case
      Returns:
      Requested placeholder types
      See Also:
    • getPlaceholderType

      public static PlaceholderType getPlaceholderType(String identifierWithoutBrackets)
      Gets the placeholder type that contains the given identifier.

      Will return null if no placeholder types contain the specified identifier.

      Parameters:
      identifierWithoutBrackets - Identifier to check
      Returns:
      Requested placeholder type
    • count

      public static int count()
      Counts the supported placeholders.
      Returns:
      Placeholders' count