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 aliasesformatterContainer
- 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 Summary
ConstructorsConstructorDescriptionAdapterContextContainer
(WorldNameResolver worldNameResolver, FormatterContainer formatterContainer) Creates an instance of aAdapterContextContainer
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of theformatterContainer
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.Returns the value of theworldNameResolver
record component.
-
Constructor Details
-
AdapterContextContainer
public AdapterContextContainer(WorldNameResolver worldNameResolver, FormatterContainer formatterContainer) Creates an instance of aAdapterContextContainer
record class.- Parameters:
worldNameResolver
- the value for theworldNameResolver
record componentformatterContainer
- the value for theformatterContainer
record 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 theworldNameResolver
record component.- Returns:
- the value of the
worldNameResolver
record component
-
formatterContainer
Returns the value of theformatterContainer
record component.- Returns:
- the value of the
formatterContainer
record component
-