Class QuantityAdapter
java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.adapters.quantity.QuantityAdapter
- All Implemented Interfaces:
Adapter
Adapter implementation for extracting quantity values from supported objects.
This adapter enables macro substitution for {OBJECT.QUANTITY}
by adapting
known types into Quantifiable
instances. Supported types include:
Quantifiable
— directly implemented by pluginsItemStack
— maps togetAmount()
Chest
— maps to inventory size viagetInventory().getSize()
Inventory
— maps to inventory size viagetSize()
Collection
— maps tosize()
Plugins may implement Quantifiable
directly to add custom macro support
for other object types.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.winterhavenmc.library.messagebuilder.pipeline.adapters.Adapter
Adapter.BuiltIn
-
Field Summary
Fields inherited from interface com.winterhavenmc.library.messagebuilder.pipeline.adapters.Adapter
UNKNOWN_VALUE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAttempts to adapt the given object into aQuantifiable
instance.
-
Constructor Details
-
QuantityAdapter
public QuantityAdapter()
-
-
Method Details
-
adapt
Attempts to adapt the given object into aQuantifiable
instance.
-