Package br.com.pawsoncloud.dtos
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
ConstructorsConstructorDescriptionAnimaisDto
(@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 aAnimaisDto
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.@NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String
especie()
Returns the value of theespecie
record component.final int
hashCode()
Returns a hash code value for this object.@NotNull(message="{campo.obrigatorio}") Integer
idade()
Returns the value of theidade
record component.@NotBlank(message="{campo.obrigatorio}") String
imgUrl()
Returns the value of theimgUrl
record component.@NotBlank(message="{campo.obrigatorio}") String
nome()
Returns the value of thenome
record component.pelagem()
Returns the value of thepelagem
record component.@NotNull(message="{campo.obrigatorio}") Double
peso()
Returns the value of thepeso
record component.@NotBlank(message="{campo.obrigatorio}") @Pattern(regexp="^[a-zA-Z-]+$",message="{campo.letras}") String
porte()
Returns the value of theporte
record component.final String
toString()
Returns a string representation of this record class.
-
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 aAnimaisDto
record class.- Parameters:
nome
- the value for thenome
record componentporte
- the value for theporte
record componentidade
- the value for theidade
record componentespecie
- the value for theespecie
record componentpelagem
- the value for thepelagem
record componentpeso
- the value for thepeso
record componentimgUrl
- the value for theimgUrl
record component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
nome
@NotBlank(message="{campo.obrigatorio}") public @NotBlank(message="{campo.obrigatorio}") String nome()Returns the value of thenome
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 theporte
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 theidade
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 theespecie
record component.- Returns:
- the value of the
especie
record component
-
pelagem
Returns the value of thepelagem
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 thepeso
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 theimgUrl
record component.- Returns:
- the value of the
imgUrl
record component
-