Record Class FuelCost

java.lang.Object
java.lang.Record
com.lightning.northstar.contraption.rocket.FuelCost

public record FuelCost(float takeoff, float travel, float landing, float efficiency) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    FuelCost(float takeoff, float travel, float landing, float efficiency)
    Creates an instance of a FuelCost record class.
  • Method Summary

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

    Methods inherited from class java.lang.Object

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

    • FuelCost

      public FuelCost(float takeoff, float travel, float landing, float efficiency)
      Creates an instance of a FuelCost record class.
      Parameters:
      takeoff - the value for the takeoff record component
      travel - the value for the travel record component
      landing - the value for the landing record component
      efficiency - the value for the efficiency record component
  • Method Details

    • total

      public float total()
    • 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 '=='.
      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.
    • takeoff

      public float takeoff()
      Returns the value of the takeoff record component.
      Returns:
      the value of the takeoff record component
    • travel

      public float travel()
      Returns the value of the travel record component.
      Returns:
      the value of the travel record component
    • landing

      public float landing()
      Returns the value of the landing record component.
      Returns:
      the value of the landing record component
    • efficiency

      public float efficiency()
      Returns the value of the efficiency record component.
      Returns:
      the value of the efficiency record component