Package com.winterhavenmc.library.messagebuilder.pipeline.adapters.protection


package com.winterhavenmc.library.messagebuilder.pipeline.adapters.protection
Provides support for adapting objects with time-based protection attributes into macro string values.

This package defines the Protectable interface, which is used to describe objects that have a protection expiration Instant. It also includes an adapter class, ProtectionAdapter, which detects and adapts compatible objects for macro string population.

Once adapted, placeholder macros such as:

  • {OBJECT.PROTECTION.DURATION}
  • {OBJECT.PROTECTION.INSTANT}
will be automatically populated using the data extracted from the Protectable object.

The DURATION macro is formatted using the library's configured DurationFormatter, while the INSTANT macro uses a localized DateTimeFormatter.

Like the Expirable adapter, this design allows developers to easily annotate domain objects with protection logic, and provides users with natural language representations of those time fields within localized messages.