Record Class PortDefinition
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.machine.PortDefinition
- Record Components:
id- unique within the machine typestorage- thestorageexposeddirection- what callers may do through itsides- faces it is exposed on, relative to the machine's facingfilter- what may pass, on top of the storage's own filterratePerTick- most that may pass per game tick (Long.MAX_VALUE: unlimited); scaled by themachineengine:transfer_ratemodifiergroup- ports of one group share sides in side configuration: each side shows at most one of them (e.g.items,energy);nullif not configurable
public record PortDefinition(@NotNull String id, @NotNull String storage, @NotNull PortDirection direction, @NotNull Set<RelativeSide> sides, @NotNull ResourcePredicate filter, long ratePerTick, @Nullable String group)
extends Record
A configured exposure of one of the machine's storages on some faces (ARCHITECTURE.md ยง11.2).
Other machines, transports and hoppers reach the storage only through ports.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPortDefinition(@NotNull String id, @NotNull String storage, @NotNull PortDirection direction, @NotNull Set<RelativeSide> sides, @NotNull ResourcePredicate filter, long ratePerTick, @Nullable String group) Creates an instance of aPortDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull PortDefinition.Builder@NotNull PortDirectionReturns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull ResourcePredicatefilter()Returns the value of thefilterrecord component.@Nullable Stringgroup()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.@NotNull Stringid()Returns the value of theidrecord component.longReturns the value of theratePerTickrecord component.@NotNull Set<RelativeSide> sides()Returns the value of thesidesrecord component.@NotNull Stringstorage()Returns the value of thestoragerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PortDefinition
public PortDefinition(@NotNull @NotNull String id, @NotNull @NotNull String storage, @NotNull @NotNull PortDirection direction, @NotNull @NotNull Set<RelativeSide> sides, @NotNull @NotNull ResourcePredicate filter, long ratePerTick, @Nullable @Nullable String group) Creates an instance of aPortDefinitionrecord class.- Parameters:
id- the value for theidrecord componentstorage- the value for thestoragerecord componentdirection- the value for thedirectionrecord componentsides- the value for thesidesrecord componentfilter- the value for thefilterrecord componentratePerTick- the value for theratePerTickrecord componentgroup- the value for thegrouprecord component
-
-
Method Details
-
builder
@NotNull public static @NotNull PortDefinition.Builder builder(@NotNull @NotNull String id, @NotNull @NotNull String storage) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
storage
-
direction
-
sides
-
filter
-
ratePerTick
public long ratePerTick()Returns the value of theratePerTickrecord component.- Returns:
- the value of the
ratePerTickrecord component
-
group
-