Package com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors.protection
package com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors.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}
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.
-
ClassesClassDescriptionAn
Accessorimplementation for adapting objects that implement theProtectableinterface.