Record Class AdapterContextContainer

java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.pipeline.adapters.AdapterContextContainer
Record Components:
worldNameResolver - the resolver responsible for resolving world name aliases
formatterContainer - the container holding time/locale-based formatters

public record AdapterContextContainer(WorldNameResolver worldNameResolver, FormatterContainer formatterContainer) 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

    • AdapterContextContainer

      public AdapterContextContainer(WorldNameResolver worldNameResolver, FormatterContainer formatterContainer)
      Creates an instance of a AdapterContextContainer record class.
      Parameters:
      worldNameResolver - the value for the worldNameResolver record component
      formatterContainer - the value for the formatterContainer 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
    • formatterContainer

      public FormatterContainer formatterContainer()
      Returns the value of the formatterContainer record component.
      Returns:
      the value of the formatterContainer record component