Files
Iris/api/src/main/java/com/volmit/mantle/MantleKey.java
T
piexel 307b89c5fe Register saved keys per module, key mantle and saved ids by ResourceId
SavedKey moves to com.volmit.data and Codec becomes StorageCodec, which
ends the clash with JsonForms.Codec. SavedKey.id and MantleKey.id are
ResourceIds, so the copied id regex is gone. Modules register saved keys
in setup with FeatureRegistry.registerSaved, owned like mantle keys, and
RunningWorld.saved rejects a key that is not the registered one.
2026-11-06 12:50:42 +01:00

16 lines
503 B
Java

package com.volmit.mantle;
import com.volmit.resource.ResourceId;
import java.util.Objects;
/** Stable storage identity. Different IDs may use the same value class without sharing data. */
public record MantleKey<T>(ResourceId id, Class<T> type) {
public MantleKey {
Objects.requireNonNull(id, "id");
Objects.requireNonNull(type, "type");
if (type.isPrimitive()) {
throw new IllegalArgumentException("Mantle values require a reference type");
}
}
}