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
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 aAudiencePlaceholderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.booleaninthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.name()Returns the value of thenamerecord component.@Nullable Tagresolve(String name, ArgumentQueue arguments, Context ctx) resolver()Returns the value of theresolverrecord 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 thetargetClassrecord 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 aAudiencePlaceholderrecord class.- Parameters:
targetClass- the value for thetargetClassrecord componentkey- the value for thekeyrecord componentname- the value for thenamerecord componentresolver- the value for theresolverrecord 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:
resolvein interfaceTagResolver
-
has
- Specified by:
hasin 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 thetargetClassrecord component.- Returns:
- the value of the
targetClassrecord component
-
key
Returns the value of thekeyrecord component.- Specified by:
keyin interfacePlaceholder- Returns:
- the value of the
keyrecord component
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfacePlaceholder- Returns:
- the value of the
namerecord component
-
resolver
Returns the value of theresolverrecord component.- Returns:
- the value of the
resolverrecord component
-