Enum TagReplacer

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TagReplacer>, java.lang.constant.Constable

    public enum TagReplacer
    extends java.lang.Enum<TagReplacer>
    Link between config and in-game messages
    Changes based on faction / player
    Interfaces the config lists with {} variables to plugin
    • Method Detail

      • values

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

        public static TagReplacer valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getByType

        protected static java.util.List<TagReplacer> getByType​(TagReplacer.TagType type)
        Returns a list of all the variables we can use for this type
        Parameters:
        type - the type we want
        Returns:
        a list of all the variables with this type
      • getValue

        protected java.lang.String getValue()
        Protected access to this generic server related variable
        Returns:
        value for this generic server related variable
      • getValue

        protected java.lang.String getValue​(Faction fac,
                                            FPlayer fp)
        Gets the value for this (as in the instance this is called from) variable!
        Parameters:
        fac - Target faction
        fp - Target player (can be null)
        Returns:
        the value for this enum!
      • replace

        public java.lang.String replace​(java.lang.String original,
                                        java.lang.String value)
        Parameters:
        original - raw line with variables
        value - what to replace var in raw line with
        Returns:
        the string with the new value
      • contains

        public boolean contains​(java.lang.String toSearch)
        Parameters:
        toSearch - raw line with variables
        Returns:
        if the raw line contains this enums variable
      • getTag

        public java.lang.String getTag()
        Gets the tag associated with this enum that we should replace
        Returns:
        the {....} variable that is located in config