BuilderObjectMapHelper
Package: com.hypixel.hytale.server.npc.asset.builder
public class BuilderObjectMapHelper<K, V> extends BuilderObjectArrayHelper<Map<K, V>, V>Reads a JSON array of builder objects and produces a Map<K, V> at build time. Each element is built, and a key is extracted from the built value using a provided Function<V, K>. Throws if duplicate keys are encountered.
Type Parameters
Section titled “Type Parameters”| Parameter | Description |
|---|---|
K | The map key type. |
V | The map value type (also the builder element type). |
Constructor
Section titled “Constructor”public BuilderObjectMapHelper(Class classType, Function<V, K> id, BuilderContext owner)Methods
Section titled “Methods”@Nullablepublic Map<K, V> build(@Nonnull BuilderSupport builderSupport)Builds each non-excluded element, extracts a key via the id function, and inserts into an ordered map. Throws IllegalArgumentException on duplicate keys.
testEach
Section titled “testEach”@Nullablepublic <T, U> T testEach(@Nonnull BiFunction<Builder<V>, U, T> test, @Nonnull BuilderManager builderManager, ExecutionContext executionContext, U meta, T successResult, T emptyResult, Builder<?> parentSpawnable)Iterates over elements, applying a test function to each resolved builder. Returns the first non-success result, or the success result if all pass.
Related Types
Section titled “Related Types”- BuilderObjectArrayHelper — parent class
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.