Skip to content

Instantly share code, notes, and snippets.

@edermfl
Created November 16, 2016 19:31
Show Gist options
  • Save edermfl/ae420419cf5b22c2283b1ead501b6d41 to your computer and use it in GitHub Desktop.
Save edermfl/ae420419cf5b22c2283b1ead501b6d41 to your computer and use it in GitHub Desktop.
public class Nf {
Integer numero;
List<Item> itens;
Cliente cliente;
public Nf(Integer numero){
this.numero = numero;
itens = new ArrayList<Item>();
}
Nf com(int quantidade, String nome) {
itens.add(new Item(nome, quantidade));
return this;
}
Nf paraCliente(String nome) {
cliente = new Cliente(nome);
return this;
}
void gerarNf() {
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment