Record Class IIngredientChannelInsertPreConsumer.Result<T>

java.lang.Object
java.lang.Record
org.cyclops.integrateddynamics.core.network.IIngredientChannelInsertPreConsumer.Result<T>
Record Components:
remaining - What still has to be inserted into the network. Only what a pre-consumer took away is missing from this.
unclaimed - What no pre-consumer has claimed yet, and a next one may still claim. Both what was taken away and what was only claimed is missing from this, so this is never larger than the remaining part.
Enclosing interface:
IIngredientChannelInsertPreConsumer<T>

public static record IIngredientChannelInsertPreConsumer.Result<T>(T remaining, T unclaimed) extends Record
The outcome of a pre-consumer insertion. These two are tracked separately because a pre-consumer can do two independent things with the insertion it observes: It can take part of it away, so that that part is no longer inserted into the network. A crafting interface does this with the produced ingredients that a dependent crafting job still needs as an input, which it moves into that job's buffer. It can also claim part of it, without taking it away: it recognizes that part as the ingredient it was waiting for, but the ingredient itself still has to reach the network storage. A crafting interface does this with the outputs of its own crafting jobs: seeing the output is what completes the job, but the output is exactly what the network asked for, so it must still be stored. Taking away reduces both, claiming only reduces the unclaimed part. Claiming has to be tracked separately for this reason: an insertion that is only claimed is passed on to the next pre-consumer unchanged, so without it, every pre-consumer would claim that same insertion for itself.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Result(T remaining, T unclaimed)
    Creates an instance of a Result record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the remaining record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the unclaimed record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Result

      public Result(T remaining, T unclaimed)
      Creates an instance of a Result record class.
      Parameters:
      remaining - the value for the remaining record component
      unclaimed - the value for the unclaimed record component
  • Method Details

    • 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.
    • remaining

      public T remaining()
      Returns the value of the remaining record component.
      Returns:
      the value of the remaining record component
    • unclaimed

      public T unclaimed()
      Returns the value of the unclaimed record component.
      Returns:
      the value of the unclaimed record component