Record Class RelationalPlaceholder<A extends Audience>
java.lang.Object
java.lang.Record
io.github.miniplaceholders.api.placeholder.RelationalPlaceholder<A>
- Type Parameters:
A- the audience type, if not specified, will be a generic Audience- Record Components:
targetClass- the target class, can be nullkey- the key of the entire placeholdername- the name of this placeholderresolver- the relational resolver, in charge of obtaining data based on a relationship of 2 audiences
- All Implemented Interfaces:
Placeholder,TagResolver
@NullMarked
public record RelationalPlaceholder<A extends Audience>(@Nullable Class<A extends Audience> targetClass, String key, String name, RelationalTagResolver<A extends Audience> resolver)
extends Record
implements Placeholder
Relational Placeholder.
This placeholder is able to obtain data based on a relationship between 2 audiences using a type-safe filter and a relational resolver.
This placeholder is able to obtain data based on a relationship between 2 audiences using a type-safe filter and a relational resolver.
-
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
ConstructorsConstructorDescriptionRelationalPlaceholder(@Nullable Class<A> targetClass, String key, String name, RelationalTagResolver<A> resolver) Creates an instance of aRelationalPlaceholderrecord 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.static <A extends Audience>
RelationalPlaceholder<A> relational(@Nullable Class<A> targetClass, String key, String name, RelationalTagResolver<A> resolver) Static method capable of creating an instance of a relational placeholder.@Nullable Tagresolve(String name, ArgumentQueue arguments, Context ctx) resolver()Returns the value of theresolverrecord component.Returns the value of thetargetClassrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
RelationalPlaceholder
public RelationalPlaceholder(@Nullable @Nullable Class<A> targetClass, @TagPattern String key, String name, RelationalTagResolver<A> resolver) Creates an instance of aRelationalPlaceholderrecord 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
-
relational
public static <A extends Audience> RelationalPlaceholder<A> relational(@Nullable @Nullable Class<A> targetClass, @TagPattern String key, String name, RelationalTagResolver<A> resolver) Static method capable of creating an instance of a relational placeholder.- Type Parameters:
A- the audience type, if not specified, will be a generic Audience- Parameters:
targetClass- the target class, can be nullkey- the key of the entire placeholdername- the name of this placeholderresolver- the relational resolver, in charge of obtaining data based on a relationship of 2 audiences- Returns:
- a new RelationalPlaceholder
- Since:
- 3.0.0
-
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
-