Record Class AccessorCtx
java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.core.context.AccessorCtx
- Record Components:
worldNameResolver- the resolver responsible for resolving world name aliasesformatterCtx- the container holding time/locale-based formatters
public record AccessorCtx(WorldNameResolver worldNameResolver, ItemNameResolver itemNameResolver, ItemDisplayNameResolver itemDisplayNameResolver, ItemPluralNameResolver itemPluralNameResolver, FormatterCtx formatterCtx)
extends Record
A simple context container that provides shared services to adapter implementations during macro extraction.
This container encapsulates external utilities and formatters that adapters may require, such as the ability to resolve user-friendly world names (via Multiverse, for example), or locale-aware formatting for durations and instants.
It is passed to certain adapters (e.g., Locatable, Expirable, Protectable)
to support context-sensitive formatting logic.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAccessorCtx(WorldNameResolver worldNameResolver, ItemNameResolver itemNameResolver, ItemDisplayNameResolver itemDisplayNameResolver, ItemPluralNameResolver itemPluralNameResolver, FormatterCtx formatterCtx) Creates an instance of aAccessorCtxrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theformatterCtxrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theitemDisplayNameResolverrecord component.Returns the value of theitemNameResolverrecord component.Returns the value of theitemPluralNameResolverrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theworldNameResolverrecord component.
-
Constructor Details
-
AccessorCtx
public AccessorCtx(WorldNameResolver worldNameResolver, ItemNameResolver itemNameResolver, ItemDisplayNameResolver itemDisplayNameResolver, ItemPluralNameResolver itemPluralNameResolver, FormatterCtx formatterCtx) Creates an instance of aAccessorCtxrecord class.- Parameters:
worldNameResolver- the value for theworldNameResolverrecord componentitemNameResolver- the value for theitemNameResolverrecord componentitemDisplayNameResolver- the value for theitemDisplayNameResolverrecord componentitemPluralNameResolver- the value for theitemPluralNameResolverrecord componentformatterCtx- the value for theformatterCtxrecord component
-
-
Method Details
-
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. -
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. -
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). -
worldNameResolver
Returns the value of theworldNameResolverrecord component.- Returns:
- the value of the
worldNameResolverrecord component
-
itemNameResolver
Returns the value of theitemNameResolverrecord component.- Returns:
- the value of the
itemNameResolverrecord component
-
itemDisplayNameResolver
Returns the value of theitemDisplayNameResolverrecord component.- Returns:
- the value of the
itemDisplayNameResolverrecord component
-
itemPluralNameResolver
Returns the value of theitemPluralNameResolverrecord component.- Returns:
- the value of the
itemPluralNameResolverrecord component
-
formatterCtx
Returns the value of theformatterCtxrecord component.- Returns:
- the value of the
formatterCtxrecord component
-