Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.cfai.cafe.business;
- import java.util.ArrayList;
- public class Client {
- // Métaphore du mille-feuille
- // Choix du paquetage
- // On déclare les attributs privés
- // On génère le ou les constructeurs
- // On génère les accesseurs et mutateurs (getters et setters)
- // On génère la méthode toString
- private int id;
- private String nom;
- private float argent;
- private Paiement paiement;
- private ArrayList <Boisson> boissonsConsommees;
- private static int compteur = 0;
- public Client() {
- id = ++compteur;
- }
- public Client(String nom, float argent, Paiement paiement) {
- this();
- this.nom = nom;
- this.argent = argent;
- this.paiement = paiement;
- }
- // Getter & Setter id
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- // Getter & Setter nom
- public String getNom() {
- return nom;
- }
- public void setNom(String nom) {
- this.nom = nom;
- }
- // Getter & Setter argent
- public float getArgent() {
- return argent;
- }
- public void setArgent(float argent) {
- this.argent = argent;
- }
- // Getter & Setter paiement
- public Paiement getPaiement() {
- return paiement;
- }
- public void setPaiement(Paiement paiement) {
- this.paiement = paiement;
- }
- // Getter & Setter BoissonsConsommees
- public ArrayList<Boisson> getBoissonsConsommees() {
- return boissonsConsommees;
- }
- public void setBoissonsConsommees(ArrayList<Boisson> boissonsConsommees) {
- this.boissonsConsommees = boissonsConsommees;
- }
- // toString
- @Override
- public String toString() {
- return "Client [id=" + id + ", nom=" + nom + ", argent=" + argent + ", paiement=" + paiement + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement