Record Class AnimaisDto

java.lang.Object
java.lang.Record
br.com.pawsoncloud.dtos.AnimaisDto

public record AnimaisDto(@NotBlank(message="{campo.obrigatorio}") String nome, @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String porte, @NotNull(message="{campo.obrigatorio}") Integer idade, @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String especie, String pelagem, @NotNull(message="{campo.obrigatorio}") Double peso, @NotBlank(message="{campo.obrigatorio}") String imgUrl) extends Record
Representa um objeto de transferência de dados (DTO) para informações de animais. Este DTO é usado para validar e transportar dados de animais para a API.
Author:
Edielson Assis
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnimaisDto(@NotBlank(message="{campo.obrigatorio}") String nome, @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String porte, @NotNull(message="{campo.obrigatorio}") Integer idade, @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String especie, String pelagem, @NotNull(message="{campo.obrigatorio}") Double peso, @NotBlank(message="{campo.obrigatorio}") String imgUrl)
    Creates an instance of a AnimaisDto record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String
    Returns the value of the especie record component.
    final int
    Returns a hash code value for this object.
    @NotNull(message="{campo.obrigatorio}") Integer
    Returns the value of the idade record component.
    @NotBlank(message="{campo.obrigatorio}") String
    Returns the value of the imgUrl record component.
    @NotBlank(message="{campo.obrigatorio}") String
    Returns the value of the nome record component.
    Returns the value of the pelagem record component.
    @NotNull(message="{campo.obrigatorio}") Double
    Returns the value of the peso record component.
    @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String
    Returns the value of the porte record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • AnimaisDto

      public AnimaisDto(@NotBlank(message="{campo.obrigatorio}") @NotBlank(message="{campo.obrigatorio}") String nome, @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String porte, @NotNull(message="{campo.obrigatorio}") @NotNull(message="{campo.obrigatorio}") Integer idade, @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String especie, String pelagem, @NotNull(message="{campo.obrigatorio}") @NotNull(message="{campo.obrigatorio}") Double peso, @NotBlank(message="{campo.obrigatorio}") @NotBlank(message="{campo.obrigatorio}") String imgUrl)
      Creates an instance of a AnimaisDto record class.
      Parameters:
      nome - the value for the nome record component
      porte - the value for the porte record component
      idade - the value for the idade record component
      especie - the value for the especie record component
      pelagem - the value for the pelagem record component
      peso - the value for the peso record component
      imgUrl - the value for the imgUrl 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.
    • nome

      @NotBlank(message="{campo.obrigatorio}") public @NotBlank(message="{campo.obrigatorio}") String nome()
      Returns the value of the nome record component.
      Returns:
      the value of the nome record component
    • porte

      @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$", message="{campo.letras}") public @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String porte()
      Returns the value of the porte record component.
      Returns:
      the value of the porte record component
    • idade

      @NotNull(message="{campo.obrigatorio}") public @NotNull(message="{campo.obrigatorio}") Integer idade()
      Returns the value of the idade record component.
      Returns:
      the value of the idade record component
    • especie

      @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$", message="{campo.letras}") public @NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String especie()
      Returns the value of the especie record component.
      Returns:
      the value of the especie record component
    • pelagem

      public String pelagem()
      Returns the value of the pelagem record component.
      Returns:
      the value of the pelagem record component
    • peso

      @NotNull(message="{campo.obrigatorio}") public @NotNull(message="{campo.obrigatorio}") Double peso()
      Returns the value of the peso record component.
      Returns:
      the value of the peso record component
    • imgUrl

      @NotBlank(message="{campo.obrigatorio}") public @NotBlank(message="{campo.obrigatorio}") String imgUrl()
      Returns the value of the imgUrl record component.
      Returns:
      the value of the imgUrl record component