Record Class StockHistoryDTO

java.lang.Object
java.lang.Record
com.raphaelsalles.backend.api.dto.StockHistoryDTO
Record Components:
period - Período de referência (ex: "2023", "3T2024").
revenue - Receita Líquida do período.
netIncome - Lucro Líquido do período.
equity - Patrimônio Líquido ao final do período.

public record StockHistoryDTO(String period, BigDecimal revenue, BigDecimal netIncome, BigDecimal equity) extends Record
DTO para Histórico Financeiro de Ações.

Propósito: Fornecer dados para plotagem de gráficos de evolução financeira (Receita, Lucro, Patrimônio).

  • Field Details

    • period

      private final String period
      The field for the period record component.
    • revenue

      private final BigDecimal revenue
      The field for the revenue record component.
    • netIncome

      private final BigDecimal netIncome
      The field for the netIncome record component.
    • equity

      private final BigDecimal equity
      The field for the equity record component.
  • Constructor Details

    • StockHistoryDTO

      public StockHistoryDTO(String period, BigDecimal revenue, BigDecimal netIncome, BigDecimal equity)
      Creates an instance of a StockHistoryDTO record class.
      Parameters:
      period - the value for the period record component
      revenue - the value for the revenue record component
      netIncome - the value for the netIncome record component
      equity - the value for the equity 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.
    • period

      public String period()
      Returns the value of the period record component.
      Returns:
      the value of the period record component
    • revenue

      public BigDecimal revenue()
      Returns the value of the revenue record component.
      Returns:
      the value of the revenue record component
    • netIncome

      public BigDecimal netIncome()
      Returns the value of the netIncome record component.
      Returns:
      the value of the netIncome record component
    • equity

      public BigDecimal equity()
      Returns the value of the equity record component.
      Returns:
      the value of the equity record component