Created
March 12, 2017 10:01
-
-
Save jeffersontpadua/1ab01a61f81aadabbb4d5ca3b57c7e81 to your computer and use it in GitHub Desktop.
POJO exemplificando o princípio da Imutabilidade.
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
import java.time.LocalDate; | |
public class Pessoa { | |
private final String nome; | |
private final String cpf; | |
private final String rg; | |
private final LocalDate dataNascimento; | |
public Pessoa(String nome, String cpf, String rg, LocalDate dataNascimento) { | |
this.nome = nome; | |
this.cpf = cpf; | |
this.rg = rg; | |
this.dataNascimento = dataNascimento; | |
} | |
public String getNome() { | |
return this.nome; | |
} | |
public String getCpf() { | |
return this.cpf; | |
} | |
public String getRg() { | |
return this.rg; | |
} | |
public LocalDate getDataNascimento() { | |
return this.dataNascimento; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment