Record Class EditarVeiculoDTO

java.lang.Object
java.lang.Record
br.com.selfmaintenance.app.records.veiculo.EditarVeiculoDTO

public record EditarVeiculoDTO(Optional<String> marca, Optional<String> modelo, Optional<Integer> ano, Optional<String> cor, String tipo) extends Record
  • Constructor Details

    • EditarVeiculoDTO

      public EditarVeiculoDTO(Optional<String> marca, Optional<String> modelo, Optional<Integer> ano, Optional<String> cor, String tipo)
      Creates an instance of a EditarVeiculoDTO record class.
      Parameters:
      marca - the value for the marca record component
      modelo - the value for the modelo record component
      ano - the value for the ano record component
      cor - the value for the cor record component
      tipo - the value for the tipo 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.
    • marca

      public Optional<String> marca()
      Returns the value of the marca record component.
      Returns:
      the value of the marca record component
    • modelo

      public Optional<String> modelo()
      Returns the value of the modelo record component.
      Returns:
      the value of the modelo record component
    • ano

      public Optional<Integer> ano()
      Returns the value of the ano record component.
      Returns:
      the value of the ano record component
    • cor

      public Optional<String> cor()
      Returns the value of the cor record component.
      Returns:
      the value of the cor record component
    • tipo

      public String tipo()
      Returns the value of the tipo record component.
      Returns:
      the value of the tipo record component