Record Class AudiencePlaceholder<A extends Audience>
java.lang.Object
java.lang.Record
io.github.miniplaceholders.api.placeholder.AudiencePlaceholder<A>
- Type Parameters:
A
- the parametrized type- Record Components:
targetClass
- the type of audience from which this placeholder can obtain informationkey
- the full placeholder keyname
- the name of this placeholderresolver
- the object responsible for obtaining audience information
- All Implemented Interfaces:
Placeholder
,TagResolver
@NullMarked
public record AudiencePlaceholder<A extends Audience>(@Nullable Class<A extends Audience> targetClass, String key, String name, AudienceTagResolver<A extends Audience> resolver)
extends Record
implements Placeholder
A placeholder that can be applied based on an audience of the specified type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.kyori.adventure.text.minimessage.tag.resolver.TagResolver
TagResolver.Builder, TagResolver.Single, TagResolver.WithoutArguments
-
Constructor Summary
ConstructorsConstructorDescriptionAudiencePlaceholder
(@Nullable Class<A> targetClass, String key, String name, AudienceTagResolver<A> resolver) Creates an instance of aAudiencePlaceholder
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.boolean
int
hashCode()
Returns a hash code value for this object.key()
Returns the value of thekey
record component.name()
Returns the value of thename
record component.@Nullable Tag
resolve
(String name, ArgumentQueue arguments, Context ctx) resolver()
Returns the value of theresolver
record component.static <A extends Audience>
AudiencePlaceholder<A> single
(@Nullable Class<A> targetClass, String key, String name, AudienceTagResolver<A> resolver) Creates a new AudiencePlaceholder.Returns the value of thetargetClass
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
AudiencePlaceholder
public AudiencePlaceholder(@Nullable @Nullable Class<A> targetClass, @TagPattern String key, String name, AudienceTagResolver<A> resolver) Creates an instance of aAudiencePlaceholder
record class.- Parameters:
targetClass
- the value for thetargetClass
record componentkey
- the value for thekey
record componentname
- the value for thename
record componentresolver
- the value for theresolver
record component
-
-
Method Details
-
single
public static <A extends Audience> AudiencePlaceholder<A> single(@Nullable @Nullable Class<A> targetClass, @TagPattern String key, String name, AudienceTagResolver<A> resolver) Creates a new AudiencePlaceholder.- Type Parameters:
A
- the parametrized type- Parameters:
targetClass
- the type of audience from which this placeholder can obtain informationkey
- the placeholder keyname
- the name of this placeholderresolver
- the object responsible for obtaining audience information- Returns:
- a new AudiencePlaceholder
-
resolve
- Specified by:
resolve
in interfaceTagResolver
-
has
- Specified by:
has
in interfaceTagResolver
-
equals
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 withObjects::equals(Object,Object)
. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
targetClass
Returns the value of thetargetClass
record component.- Returns:
- the value of the
targetClass
record component
-
key
Returns the value of thekey
record component.- Specified by:
key
in interfacePlaceholder
- Returns:
- the value of the
key
record component
-
name
Returns the value of thename
record component.- Specified by:
name
in interfacePlaceholder
- Returns:
- the value of the
name
record component
-
resolver
Returns the value of theresolver
record component.- Returns:
- the value of the
resolver
record component
-