Skip to content
Snippets Groups Projects
TimeOff.java 1.28 KiB
Newer Older
  • Learn to ignore specific revisions
  • package com.example.schedulerapp;
    
    import java.time.LocalDateTime;
    
    public class TimeOff {
        private final int ID;
        private final int employeeID;
        private final String startDate;
        private final String endDate;
        private boolean approval;
        private final String reason;
    
        public TimeOff(String[] timeOffSplit){
            this.ID = Integer.parseInt(timeOffSplit[0]);
            this.employeeID = Integer.parseInt(timeOffSplit[1]);
            this.startDate = timeOffSplit[2];
            this.endDate = timeOffSplit[3];
            this.approval = Boolean.getBoolean(timeOffSplit[4]);
            this.reason = timeOffSplit[5];
        }
    
        public int getID() {
            return ID;
        }
    
        public int getEmployeeID() {
            return employeeID;
        }
    
        public String getStartDate() {
            return startDate;
        }
    
        public String getEndDate() {
            return endDate;
        }
    
        public boolean isApproval() {
            return approval;
        }
    
        public String getReason() {
            return reason;
        }
    
        /*
        ONLY USE for updating locally, if you're trying to update it on the server look for a method in the Model class.
        This is for the ReceiveThread class to update changes from the server.
         */
        public void setApproval(boolean approval) {
            this.approval = approval;
        }
    }