Record Class TextPlaceholderValueProvider

java.lang.Object
java.lang.Record
me.hsgamer.topper.fabric.hook.textplaceholderapi.TextPlaceholderValueProvider
All Implemented Interfaces:
Function<net.minecraft.server.network.ServerPlayerEntity,me.hsgamer.topper.value.core.ValueWrapper<String>>, me.hsgamer.topper.value.core.ValueProvider<net.minecraft.server.network.ServerPlayerEntity,String>

public record TextPlaceholderValueProvider(String placeholder) extends Record implements me.hsgamer.topper.value.core.ValueProvider<net.minecraft.server.network.ServerPlayerEntity,String>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a TextPlaceholderValueProvider record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull me.hsgamer.topper.value.core.ValueWrapper<String>
    apply(@NotNull net.minecraft.server.network.ServerPlayerEntity key)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the placeholder record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.function.Function

    andThen, compose

    Methods inherited from interface me.hsgamer.topper.value.core.ValueProvider

    beforeApply, thenApply
  • Constructor Details

    • TextPlaceholderValueProvider

      public TextPlaceholderValueProvider(String placeholder)
      Creates an instance of a TextPlaceholderValueProvider record class.
      Parameters:
      placeholder - the value for the placeholder record component
  • Method Details

    • apply

      @NotNull public @NotNull me.hsgamer.topper.value.core.ValueWrapper<String> apply(@NotNull @NotNull net.minecraft.server.network.ServerPlayerEntity key)
      Specified by:
      apply in interface Function<net.minecraft.server.network.ServerPlayerEntity,me.hsgamer.topper.value.core.ValueWrapper<String>>
      Specified by:
      apply in interface me.hsgamer.topper.value.core.ValueProvider<net.minecraft.server.network.ServerPlayerEntity,String>
    • toString

      public final 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
    • equals

      public final boolean equals(Object o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • placeholder

      public String placeholder()
      Returns the value of the placeholder record component.
      Returns:
      the value of the placeholder record component