Record Class GlobalPlaceholder

java.lang.Object
java.lang.Record
io.github.miniplaceholders.api.placeholder.GlobalPlaceholder
Record Components:
key - the placeholder key
name - the placeholder name
resolver - the object responsible for providing information
All Implemented Interfaces:
Placeholder, TagResolver

public record GlobalPlaceholder(String key, String name, GlobalTagResolver resolver) extends Record implements Placeholder
A placeholder that can obtain data without the need to provide an Audience or RelationalAudience.
  • Constructor Details

    • GlobalPlaceholder

      public GlobalPlaceholder(@TagPattern String key, String name, GlobalTagResolver resolver)
      Creates an instance of a GlobalPlaceholder record class.
      Parameters:
      key - the value for the key record component
      name - the value for the name record component
      resolver - the value for the resolver record component
  • Method Details

    • resolve

      @Nullable public @Nullable Tag resolve(@NotNull @NotNull String name, @NotNull @NotNull ArgumentQueue arguments, @NotNull @NotNull Context ctx)
      Specified by:
      resolve in interface TagResolver
    • has

      public boolean has(@NotNull @NotNull String name)
      Specified by:
      has in interface TagResolver
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • key

      @TagPattern public String key()
      Returns the value of the key record component.
      Specified by:
      key in interface Placeholder
      Returns:
      the value of the key record component
    • name

      public String name()
      Returns the value of the name record component.
      Specified by:
      name in interface Placeholder
      Returns:
      the value of the name record component
    • resolver

      public GlobalTagResolver resolver()
      Returns the value of the resolver record component.
      Returns:
      the value of the resolver record component