WallHero

Order class

Oct 2nd, 2020
1,392
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Date;
  2.  
  3. public class Order {
  4.     private int numberAffiliate;
  5.     private char plan;
  6.     private int codeAnalysis;
  7.     private int enrollment;
  8.     private Date date;
  9.     private boolean status;
  10.     private float discount;
  11.    
  12.     public Order() {
  13.         // TODO Auto-generated constructor stub
  14.     }
  15.     public Order(int numberAffiliate, char plan, int codeAnalysis, int enrollment, Date date, boolean status, float discount)
  16.     {
  17.         this.numberAffiliate = numberAffiliate;
  18.         this.plan = plan;
  19.         this.codeAnalysis = codeAnalysis;
  20.         this.enrollment = enrollment;
  21.         this.date = date;
  22.         this.status = status;
  23.         this.discount = discount;
  24.     }
  25.    
  26.     @Override
  27.     public String toString() {
  28.         return "Número de afiliado: " + this.numberAffiliate + "\nPlan: " + this.plan + "\nCódigo de estudio:" + this.codeAnalysis + "\nMatrícula de médico: " +  this.enrollment + "\nFecha: " + date.toGMTString() + "\nEstado: " + ((status) ? "Aprobado" : "Rechazado") + "\nDescuento:" + this.discount + "%";
  29.     }
  30.    
  31.     public int getNumberAffiliate() {
  32.         return numberAffiliate;
  33.     }
  34.     public void setNumberAffiliate(int numberAffiliate) {
  35.         this.numberAffiliate = numberAffiliate;
  36.     }
  37.     public char getPlan() {
  38.         return plan;
  39.     }
  40.     public void setPlan(char plan) {
  41.         this.plan = plan;
  42.     }
  43.     public int getCodeAnalysis() {
  44.         return codeAnalysis;
  45.     }
  46.     public void setCodeAnalysis(int codeAnalysis) {
  47.         this.codeAnalysis = codeAnalysis;
  48.     }
  49.     public int getEnrollment() {
  50.         return enrollment;
  51.     }
  52.     public void setEnrollment(int enrollment) {
  53.         this.enrollment = enrollment;
  54.     }
  55.     public Date getDate() {
  56.         return date;
  57.     }
  58.     public void setDate(Date date) {
  59.         this.date = date;
  60.     }
  61.     public boolean isStatus() {
  62.         return status;
  63.     }
  64.     public void setStatus(boolean status) {
  65.         this.status = status;
  66.     }
  67.     public float getDiscount() {
  68.         return discount;
  69.     }
  70.     public void setDiscount(float discount) {
  71.         this.discount = discount;
  72.     }
  73. }
  74.  
RAW Paste Data