Created
February 8, 2018 16:30
-
-
Save AntonioMontanha/6a1f2e877b4c452160e7f7cd19de4828 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.montanha.gerenciador.dtos; | |
import java.io.Serializable; | |
import java.util.Date; | |
import javax.validation.constraints.NotNull; | |
import org.hibernate.validator.constraints.Length; | |
import com.fasterxml.jackson.annotation.JsonFormat; | |
public class ViagemDto implements Serializable { | |
private static final long serialVersionUID = -8105241933692707649L; | |
private Long id; | |
private String localDeDestino; | |
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") | |
private Date dataPartida; | |
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") | |
private Date dataRetorno; | |
private String acompanhante; | |
public ViagemDto() { | |
} | |
public Long getId() { | |
return id; | |
} | |
public void setId(Long id) { | |
this.id = id; | |
} | |
@NotNull(message = "Local de Destino é uma informação obrigatória") | |
@Length(min = 3, max = 40, message = "Local de Destino deve estar entre 3 e 40 caracteres") | |
public String getLocalDeDestino() { | |
return localDeDestino; | |
} | |
public void setLocalDeDestino(String localDeDestino) { | |
this.localDeDestino = localDeDestino; | |
} | |
@NotNull(message = "Data da Partida é uma informação obrigatória") | |
public Date getDataPartida() { | |
return dataPartida; | |
} | |
public void setDataPartida(Date dataPartida) { | |
this.dataPartida = dataPartida; | |
} | |
public Date getDataRetorno() { | |
return dataRetorno; | |
} | |
public void setDataRetorno(Date dataRetorno) { | |
this.dataRetorno = dataRetorno; | |
} | |
public String getAcompanhante() { | |
return acompanhante; | |
} | |
public void setAcompanhante(String acompanhante) { | |
this.acompanhante = acompanhante; | |
} | |
@Override | |
public String toString() { | |
return "ViagemDto [id=" + id + ", localDeDestino=" + localDeDestino + ", dataPartida=" + dataPartida | |
+ ", dataRetorno=" + dataRetorno + ", acompanhante=" + acompanhante + "]"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment