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 aRelationalPlaceholder
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.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 Tag
resolve
(String name, ArgumentQueue arguments, Context ctx) resolver()
Returns the value of theresolver
record component.Returns the value of thetargetClass
record 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 aRelationalPlaceholder
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
-
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:
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
-