Class ResourceComponents
java.lang.Object
fr.robie.machineengine.api.resource.ResourceComponents
Immutable component values of a resource variant (ARCHITECTURE.md ยง9.2).
Components whose type is no longer registered are kept as raw data and written back unchanged (D3). They take part in equality, so such a variant never stacks with anything else.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ResourceComponents.Builderbuilder()boolean<T> @NotNull Optional<T> find(@NotNull ResourceComponentType<T> type) <T> Tget(@NotNull ResourceComponentType<T> type) booleanhas(@NotNull ResourceComponentType<?> type) inthashCode()booleanisEmpty()static <T> @NotNull ResourceComponentsof(@NotNull ResourceComponentType<T> type, T value) @NotNull ResourceComponents.BuildertoString()@NotNull Set<ResourceComponentType<?>> types()Known component types, sorted by key for deterministic encoding.unknown()Raw data of components whose type is not registered, by component key.<T> @NotNull ResourceComponentswith(@NotNull ResourceComponentType<T> type, T value) @NotNull ResourceComponentswithout(@NotNull ResourceComponentType<?> type)
-
Field Details
-
EMPTY
-
-
Method Details
-
builder
-
of
@NotNull public static <T> @NotNull ResourceComponents of(@NotNull @NotNull ResourceComponentType<T> type, @NotNull T value) -
get
-
find
-
has
-
types
Known component types, sorted by key for deterministic encoding. -
unknown
-
isEmpty
public boolean isEmpty() -
with
@NotNull public <T> @NotNull ResourceComponents with(@NotNull @NotNull ResourceComponentType<T> type, @NotNull T value) -
without
@NotNull public @NotNull ResourceComponents without(@NotNull @NotNull ResourceComponentType<?> type) -
toBuilder
-
equals
-
hashCode
-
toString
-