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 aliases
formatterCtx - 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 Details

    • AccessorCtx

      public AccessorCtx(WorldNameResolver worldNameResolver, ItemNameResolver itemNameResolver, ItemDisplayNameResolver itemDisplayNameResolver, ItemPluralNameResolver itemPluralNameResolver, FormatterCtx formatterCtx)
      Creates an instance of a AccessorCtx record class.
      Parameters:
      worldNameResolver - the value for the worldNameResolver record component
      itemNameResolver - the value for the itemNameResolver record component
      itemDisplayNameResolver - the value for the itemDisplayNameResolver record component
      itemPluralNameResolver - the value for the itemPluralNameResolver record component
      formatterCtx - the value for the formatterCtx record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • worldNameResolver

      public WorldNameResolver worldNameResolver()
      Returns the value of the worldNameResolver record component.
      Returns:
      the value of the worldNameResolver record component
    • itemNameResolver

      public ItemNameResolver itemNameResolver()
      Returns the value of the itemNameResolver record component.
      Returns:
      the value of the itemNameResolver record component
    • itemDisplayNameResolver

      public ItemDisplayNameResolver itemDisplayNameResolver()
      Returns the value of the itemDisplayNameResolver record component.
      Returns:
      the value of the itemDisplayNameResolver record component
    • itemPluralNameResolver

      public ItemPluralNameResolver itemPluralNameResolver()
      Returns the value of the itemPluralNameResolver record component.
      Returns:
      the value of the itemPluralNameResolver record component
    • formatterCtx

      public FormatterCtx formatterCtx()
      Returns the value of the formatterCtx record component.
      Returns:
      the value of the formatterCtx record component