Record Class TaxCalculator.TaxResult

java.lang.Object
java.lang.Record
org.episteme.social.economics.TaxCalculator.TaxResult
Enclosing class:
TaxCalculator

public static record TaxCalculator.TaxResult(Money grossIncome, Money taxableIncome, Money taxOwed, Real effectiveRate, Real marginalRate, Money netIncome) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    TaxResult(Money grossIncome, Money taxableIncome, Money taxOwed, Real effectiveRate, Real marginalRate, Money netIncome)
    Creates an instance of a TaxResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the effectiveRate record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the grossIncome record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the marginalRate record component.
    Returns the value of the netIncome record component.
    Returns the value of the taxableIncome record component.
    Returns the value of the taxOwed 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

    • TaxResult

      public TaxResult(Money grossIncome, Money taxableIncome, Money taxOwed, Real effectiveRate, Real marginalRate, Money netIncome)
      Creates an instance of a TaxResult record class.
      Parameters:
      grossIncome - the value for the grossIncome record component
      taxableIncome - the value for the taxableIncome record component
      taxOwed - the value for the taxOwed record component
      effectiveRate - the value for the effectiveRate record component
      marginalRate - the value for the marginalRate record component
      netIncome - the value for the netIncome 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.
    • grossIncome

      public Money grossIncome()
      Returns the value of the grossIncome record component.
      Returns:
      the value of the grossIncome record component
    • taxableIncome

      public Money taxableIncome()
      Returns the value of the taxableIncome record component.
      Returns:
      the value of the taxableIncome record component
    • taxOwed

      public Money taxOwed()
      Returns the value of the taxOwed record component.
      Returns:
      the value of the taxOwed record component
    • effectiveRate

      public Real effectiveRate()
      Returns the value of the effectiveRate record component.
      Returns:
      the value of the effectiveRate record component
    • marginalRate

      public Real marginalRate()
      Returns the value of the marginalRate record component.
      Returns:
      the value of the marginalRate record component
    • netIncome

      public Money netIncome()
      Returns the value of the netIncome record component.
      Returns:
      the value of the netIncome record component