Record Class ProcessBinding

java.lang.Object
java.lang.Record
fr.robie.machineengine.api.process.ProcessBinding
Record Components:
inputs - storages inputs are taken from (and returned to on cancel), in order
output - storage outputs go to
costs - storages per-tick costs are paid from: each cost is taken from these storages in order (e.g. energy, then a chemical tank); empty (or null) for the first input storage
extraOutputs - more storages outputs go to when output does not take them (e.g. an item slot and a chemical tank); empty (or null) for none

public record ProcessBinding(@NotNull List<String> inputs, @NotNull String output, @Nullable List<String> costs, @Nullable List<String> extraOutputs) extends Record
Which machine storages a process uses.
  • Constructor Details

    • ProcessBinding

      public ProcessBinding(@NotNull @NotNull List<String> inputs, @NotNull @NotNull String output, @Nullable @Nullable List<String> costs, @Nullable @Nullable List<String> extraOutputs)
      Creates an instance of a ProcessBinding record class.
      Parameters:
      inputs - the value for the inputs record component
      output - the value for the output record component
      costs - the value for the costs record component
      extraOutputs - the value for the extraOutputs record component
    • ProcessBinding

      public ProcessBinding(@NotNull @NotNull List<String> inputs, @NotNull @NotNull String output, @Nullable @Nullable List<String> costs)
  • Method Details

    • outputs

      @NotNull public @NotNull List<String> outputs()
      Every output storage, in the order outputs try them.
    • withExtraOutputs

      @NotNull public @NotNull ProcessBinding withExtraOutputs(@NotNull @NotNull String... storages)
      This binding, with outputs also going to storages.
    • of

      @NotNull public static @NotNull ProcessBinding of(@NotNull @NotNull String input, @NotNull @NotNull String output)
    • withCosts

      @NotNull public @NotNull ProcessBinding withCosts(@NotNull @NotNull String... costs)
    • costStorages

      @NotNull public @NotNull List<String> costStorages()
      Storages costs are paid from, in order; never empty unless there are no inputs either.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • inputs

      @NotNull public @NotNull List<String> inputs()
      Returns the value of the inputs record component.
      Returns:
      the value of the inputs record component
    • output

      @NotNull public @NotNull String output()
      Returns the value of the output record component.
      Returns:
      the value of the output record component
    • costs

      @Nullable public @Nullable List<String> costs()
      Returns the value of the costs record component.
      Returns:
      the value of the costs record component
    • extraOutputs

      @Nullable public @Nullable List<String> extraOutputs()
      Returns the value of the extraOutputs record component.
      Returns:
      the value of the extraOutputs record component