java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.adapters.instant.InstantAdapter
All Implemented Interfaces:
Adapter

public class InstantAdapter extends Object implements Adapter
An adapter that supports any object implementing the Instantable interface.

This adapter enables macro resolution for objects that expose an Instant via the getInstant() method. It contributes the macro field:

{OBJECT.INSTANT}
to the MacroStringMap used for message composition and formatting.

This adapter is automatically registered with the AdapterRegistry in the core pipeline and is available for plugin-defined objects that implement the Instantable interface.

  • Constructor Details

    • InstantAdapter

      public InstantAdapter()
  • Method Details

    • adapt

      public Optional<Instantable> adapt(Object obj)
      Attempts to adapt an object into an Instantable, if it already implements the interface.
      Specified by:
      adapt in interface Adapter
      Parameters:
      obj - the object to adapt
      Returns:
      an Optional containing the adapted Instantable, or empty if unsupported