Record Class CapabilityBinding<T>
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.machine.CapabilityBinding<T>
- Record Components:
sides- faces it is exposed on; empty means "not sided" (any face, or no face)factory- creates the capability object once per machine instance
public record CapabilityBinding<T>(@NotNull CapabilityType<T> type, @NotNull Set<RelativeSide> sides, @NotNull Function<MachineContext, ? extends T> factory)
extends Record
An extra capability a machine type exposes, besides the resource handlers of its ports.
-
Constructor Summary
ConstructorsConstructorDescriptionCapabilityBinding(@NotNull CapabilityType<T> type, @NotNull Set<RelativeSide> sides, @NotNull Function<MachineContext, ? extends T> factory) Creates an instance of aCapabilityBindingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NotNull Function<MachineContext, ? extends T> factory()Returns the value of thefactoryrecord component.final inthashCode()Returns a hash code value for this object.static <T> @NotNull CapabilityBinding<T> of(@NotNull CapabilityType<T> type, @NotNull Function<MachineContext, ? extends T> factory) @NotNull Set<RelativeSide> sides()Returns the value of thesidesrecord component.final StringtoString()Returns a string representation of this record class.@NotNull CapabilityType<T> type()Returns the value of thetyperecord component.
-
Constructor Details
-
CapabilityBinding
public CapabilityBinding(@NotNull @NotNull CapabilityType<T> type, @NotNull @NotNull Set<RelativeSide> sides, @NotNull @NotNull Function<MachineContext, ? extends T> factory) Creates an instance of aCapabilityBindingrecord class.
-
-
Method Details
-
of
@NotNull public static <T> @NotNull CapabilityBinding<T> of(@NotNull @NotNull CapabilityType<T> type, @NotNull @NotNull Function<MachineContext, ? extends T> factory) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
sides
-
factory
-