Record Class RelationalAudience<A extends Audience>

java.lang.Object
java.lang.Record
io.github.miniplaceholders.api.types.RelationalAudience<A>
Type Parameters:
A - the audiences type
Record Components:
audience - the principal audience
relational - the secondary audience, with which the relationship will be evaluated
All Implemented Interfaces:
Audience, ForwardingAudience, ForwardingAudience.Single, Pointered

public record RelationalAudience<A extends Audience>(A extends Audience audience, A extends Audience relational) extends Record implements ForwardingAudience.Single
A relationship between 2 Audiences.
Since:
3.0.0
  • Constructor Details

    • RelationalAudience

      public RelationalAudience(A audience, A relational)
      Creates an instance of a RelationalAudience record class.
      Parameters:
      audience - the value for the audience record component
      relational - the value for the relational record component
  • Method Details

    • from

      public static <A extends Audience> RelationalAudience<A> from(A audience, A relational)
      Creates a new relation between two audiences.
      Type Parameters:
      A - the audiences type
      Parameters:
      audience - the principal audience
      relational - the secondary audience, with which the relationship will be evaluated
      Returns:
      a new relation
      Since:
      3.0.0
    • 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.
    • audience

      public A audience()
      Returns the value of the audience record component.
      Specified by:
      audience in interface ForwardingAudience.Single
      Returns:
      the value of the audience record component
    • relational

      public A relational()
      Returns the value of the relational record component.
      Returns:
      the value of the relational record component