mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
Baseline IrisApi draft before stage-graph redesign
This commit is contained in:
commit
9043d93fbd
91 files changed
+4045
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package com.volmit.resource;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/** A resource ID paired with its public value type; the host owns loading and caching. */
|
||||
public record ResourceKey<T>(ResourceId id, Class<T> type) {
|
||||
public ResourceKey {
|
||||
Objects.requireNonNull(id, "id");
|
||||
Objects.requireNonNull(type, "type");
|
||||
if (type.isPrimitive()) throw new IllegalArgumentException("Resources require a reference type");
|
||||
}
|
||||
|
||||
public ResourceKey(String id, Class<T> type) { this(ResourceId.parse(id), type); }
|
||||
}
|
||||
Reference in new issue
Block a user