iuliaa

Untitled

Jun 18th, 2020
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.68 KB | None | 0 0
  1. package org.bsa.model;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Objects;
  5.  
  6. public class Appointment {
  7.     String date;
  8.     String empl;
  9.     String client;
  10.     Boolean status;
  11.      ArrayList<Service> services;
  12.      String servicesList;
  13.  
  14.     public Appointment(){}
  15.  
  16.     public Appointment(Boolean status,String date, String empl, String client, ArrayList<Service> services) {
  17.         this.date = date;
  18.         this.empl = empl;
  19.         this.client = client;
  20.         this.status = status;
  21.         this.services = services;
  22.         for(Service s:services) {
  23.             servicesList = getServicesList();
  24.         }
  25.     }
  26.  
  27.  
  28.    public  String getServicesList(){
  29.         servicesList="";
  30.         for(Service s:services) {
  31.             servicesList = servicesList+ s.getType()+"; ";
  32.         }
  33.         return servicesList;
  34.     }
  35.  
  36.     @Override
  37.     public boolean equals(Object o) {
  38.         if (this == o) return true;
  39.         if (!(o instanceof Appointment)) return false;
  40.         Appointment that = (Appointment) o;
  41.         return date.equals(that.date) &&
  42.                 empl.equals(that.empl) &&
  43.                 client.equals(that.client) &&
  44.                 status.equals(that.status) &&
  45.                 services.equals(that.services) &&
  46.                 servicesList.equals(that.servicesList);
  47.     }
  48.  
  49.     @Override
  50.     public int hashCode() {
  51.         return Objects.hash(date, empl, client, status, services, servicesList);
  52.     }
  53.  
  54.     public String getClient() {
  55.         return client;
  56.     }
  57.  
  58.     public void setClient(String client) {
  59.         this.client = client;
  60.     }
  61.  
  62.     public void setServicesList(String servicesList) {
  63.         this.servicesList = servicesList;
  64.     }
  65.  
  66.     public String getDate() {
  67.         return date;
  68.     }
  69.  
  70.     public void setDate(String date) {
  71.         this.date = date;
  72.     }
  73.  
  74.     public String getEmpl() {
  75.         return empl;
  76.     }
  77.  
  78.     public void setEmpl(String empl) {
  79.         this.empl = empl;
  80.     }
  81.  
  82.     public Boolean getStatus() {
  83.         return status;
  84.     }
  85.  
  86.     public void setStatus(Boolean status) {
  87.         this.status = status;
  88.     }
  89.  
  90.     public ArrayList<Service> getServices() {
  91.         return services;
  92.     }
  93.  
  94.     public void setServices(ArrayList<Service> services) {
  95.         this.services = services;
  96.     }
  97.  
  98.  
  99.     @Override
  100.     public String toString() {
  101.         return "Appointment{" +
  102.                 "date='" + date + '\'' +
  103.                 ", empl='" + empl + '\'' +
  104.                 ", client='" + client + '\'' +
  105.                 ", status=" + status +
  106.                 ", services=" + services +
  107.                 ", servicesList='" + servicesList + '\'' +
  108.                 '}';
  109.     }
  110. }
Add Comment
Please, Sign In to add comment