Skip to content

Instantly share code, notes, and snippets.

@gabrielslau
Created June 20, 2012 21:17
Show Gist options
  • Select an option

  • Save gabrielslau/2962291 to your computer and use it in GitHub Desktop.

Select an option

Save gabrielslau/2962291 to your computer and use it in GitHub Desktop.
Atividade JAVA - Karlysson
public class Cliente {
private Integer codCliente;
private String nome;
private String telefone;
private String endereco;
private String dataNascimento;
private String dataCadastro;
// Construtores
public Cliente() {}
public Cliente(Integer codCliente, String nome, String telefone, String endereco, String dataNascimento, String dataCadastro) {
this.codCliente = codCliente;
this.nome = nome;
this.telefone = telefone;
this.endereco = endereco;
this.dataNascimento = dataNascimento;
this.dataCadastro = dataCadastro;
}
// Getters
public Integer getCodCliente() {
return this.codCliente;
}
public String getNome() {
return this.nome;
}
public String getTelefone() {
return this.telefone;
}
public String getEndereco() {
return this.endereco;
}
public String getDataNascimento() {
return this.dataNascimento;
}
public String getDataCadastro() {
return this.dataCadastro;
}
// Setters
public void setCodCliente(String codCliente) {
this.codCliente = codCliente;
}
public void setNome(String nome) {
this.nome = nome;
}
public void setTelefone(String telefone) {
this.telefone = telefone;
}
public void setEndereco(String endereco) {
this.endereco = endereco;
}
public void setDataNascimento(String dataNascimento) {
this.dataNascimento = dataNascimento;
}
public void setDataCadastro(String dataCadastro) {
this.dataCadastro = dataCadastro;
}
}
public class Venda extends Cliente{
private Integer codVenda;
private String dataVenda;
private String formaPagamento;
private Cliente cliente;
private Float valor;
private ArrayList itens;
// Construtores
public Venda() {}
public Venda(Integer codVenda, String dataVenda, String formaPagamento, String valor, ArrayList itens) {
this.codCliente = codCliente;
this.dataVenda = dataVenda;
this.formaPagamento = formaPagamento;
this.valor = valor;
this.itens = itens;
}
// Getters
public Integer getCodVenda() {
return this.codVenda;
}
public String getDataVenda() {
return this.dataVenda;
}
public String getFormaPagamento() {
return this.formaPagamento;
}
public String getValor() {
return this.valor;
}
public ArrayList getItens() {
return this.itens;
}
// Dados do cliente
public String getCodCliente() {
return this.cliente.getCodCliente;
}
//
// Acessa os dados da classe Cliente
//
// Setters
public void setCodCliente(String codCliente) {
this.codCliente = codCliente;
}
public void setNome(String nome) {
this.nome = nome;
}
public void setTelefone(String telefone) {
this.telefone = telefone;
}
public void setEndereco(String endereco) {
this.endereco = endereco;
}
public void setDataNascimento(String dataNascimento) {
this.dataNascimento = dataNascimento;
}
public void setDataCadastro(String dataCadastro) {
this.dataCadastro = dataCadastro;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment