Record Class FusionOdds

java.lang.Object
java.lang.Record
dev.yowsef.stealablock.api.fusion.FusionOdds

public record FusionOdds(@NotNull String sourceBlockId, @NotNull String currentMutationId, int requiredBlocks, double successChance, @NotNull Map<String,Double> mutationRollWeights) extends Record
Calculated odds for a fusion attempt after applying active events and modifiers.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FusionOdds(@NotNull String sourceBlockId, @NotNull String currentMutationId, int requiredBlocks, double successChance, @NotNull Map<String,Double> mutationRollWeights)
    Creates an instance of a FusionOdds record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Returns the value of the currentMutationId record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull Map<String,Double>
    Returns the value of the mutationRollWeights record component.
    int
    Returns the value of the requiredBlocks record component.
    @NotNull String
    Returns the value of the sourceBlockId record component.
    double
    Returns the value of the successChance record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • FusionOdds

      public FusionOdds(@NotNull @NotNull String sourceBlockId, @NotNull @NotNull String currentMutationId, int requiredBlocks, double successChance, @NotNull @NotNull Map<String,Double> mutationRollWeights)
      Creates an instance of a FusionOdds record class.
      Parameters:
      sourceBlockId - the value for the sourceBlockId record component
      currentMutationId - the value for the currentMutationId record component
      requiredBlocks - the value for the requiredBlocks record component
      successChance - the value for the successChance record component
      mutationRollWeights - the value for the mutationRollWeights 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • sourceBlockId

      @NotNull public @NotNull String sourceBlockId()
      Returns the value of the sourceBlockId record component.
      Returns:
      the value of the sourceBlockId record component
    • currentMutationId

      @NotNull public @NotNull String currentMutationId()
      Returns the value of the currentMutationId record component.
      Returns:
      the value of the currentMutationId record component
    • requiredBlocks

      public int requiredBlocks()
      Returns the value of the requiredBlocks record component.
      Returns:
      the value of the requiredBlocks record component
    • successChance

      public double successChance()
      Returns the value of the successChance record component.
      Returns:
      the value of the successChance record component
    • mutationRollWeights

      @NotNull public @NotNull Map<String,Double> mutationRollWeights()
      Returns the value of the mutationRollWeights record component.
      Returns:
      the value of the mutationRollWeights record component