Record Class FeedbackImpl

java.lang.Object
java.lang.Record
com.thewinterframework.configurate.feedback.FeedbackImpl
All Implemented Interfaces:
Feedback, FeedbackMediaContainer

public record FeedbackImpl(List<FeedbackMedia> medias) extends Record implements Feedback, FeedbackMediaContainer
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    @NotNull List<net.kyori.adventure.text.Component>
    asComponents(net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolver)
    Converts the feedback to a list of components.
    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 medias record component.
    void
    send(net.kyori.adventure.audience.Audience audience, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolver)
    Sends the feedback to the specified Audience.
    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 com.thewinterframework.configurate.feedback.Feedback

    asComponent, sendFeedback
  • Constructor Details

    • FeedbackImpl

      public FeedbackImpl(List<FeedbackMedia> medias)
      Creates an instance of a FeedbackImpl record class.
      Parameters:
      medias - the value for the medias record component
  • Method Details

    • send

      public void send(net.kyori.adventure.audience.Audience audience, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolver)
      Description copied from interface: Feedback
      Sends the feedback to the specified Audience.
      Specified by:
      send in interface Feedback
      Parameters:
      audience - the audience to send the feedback to
      resolver - the tag resolvers to use
    • asComponents

      @NotNull public @NotNull List<net.kyori.adventure.text.Component> asComponents(net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolver) throws IllegalStateException
      Description copied from interface: Feedback
      Converts the feedback to a list of components.
      Specified by:
      asComponents in interface Feedback
      Parameters:
      resolver - the tag resolvers to use
      Returns:
      the list of component representation of the feedback
      Throws:
      IllegalStateException - if the feedback cannot be converted to components
    • 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.
    • medias

      public List<FeedbackMedia> medias()
      Returns the value of the medias record component.
      Specified by:
      medias in interface FeedbackMediaContainer
      Returns:
      the value of the medias record component