Information

0
Story Points

Technologies

Decompiled Java File
package com.mpdmal.cloudental.entities;

import com.mpdmal.cloudental.entities.Dentist;
import com.mpdmal.cloudental.entities.base.DBEntity;
import com.mpdmal.cloudental.util.CloudentUtils;
import com.mpdmal.cloudental.util.CloudentUtils.EventTitleFormatType;
import com.mpdmal.cloudental.util.exception.InvalidTitleFormatTypeException;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

@Entity
public class UserPreferences extends DBEntity {
   public static final String DEFAULT_USER_THEME = "aristo";
   public static final String DEFAULT_USER_EMAILCONTENT = "";
   public static final String DEFAULT_USER_PRESCRIPTIONHEADER = "";
   public static final String DEFAULT_USER_REPORTEMAIL = "";
   public static final boolean DEFAULT_USER_EMAILNOTIFICATIONS = true;
   public static final boolean DEFAULT_USER_DAILYREPORTS = true;
   public static final int DEFAULT_USER_SCHEDMINHR = 6;
   public static final int DEFAULT_USER_SCHEDMAXHR = 22;
   public static final int DEFAULT_USER_SCHEDSTARTHR = 8;
   public static final int DEFAULT_USER_EVTITLEFORMAT;
   public static final int DEFAULT_USER_SCHEDSLOTMINS = 5;
   @Id
   @OneToOne
   @JoinColumn(
      name = "userid"
   )
   private Dentist dentist;
   private String emailcontent;
   private boolean emailnotification;
   private boolean dailyreports;
   private int eventtitleformat;
   private String theme;
   private String reportemail;
   private String prescriptionheader;
   private int scheduler_minhr;
   private int scheduler_maxhr;
   private int scheduler_starthr;
   private int scheduler_slotmins;

   public String getTheme() {
      return this.theme;
   }

   public String getEmailcontent() {
      return this.emailcontent;
   }

   public Dentist getDentist() {
      return this.dentist;
   }

   public int getSchedulerMinHour() {
      return this.scheduler_minhr;
   }

   public int getSchedulerMaxHour() {
      return this.scheduler_maxhr;
   }

   public int getSchedulerStartHour() {
      return this.scheduler_starthr;
   }

   public int getSchedulerSlotMins() {
      return this.scheduler_slotmins;
   }

   public int getEventTitleFormatType() {
      return this.eventtitleformat;
   }

   public String getPrescriptionHeader() {
      return this.prescriptionheader;
   }

   public boolean isEmailnotification() {
      return this.emailnotification;
   }

   public boolean isDailyreports() {
      return this.dailyreports;
   }

   public String getReportemail() {
      return this.reportemail;
   }

   public void setEventTitleFormatType(int type) throws InvalidTitleFormatTypeException {
      if(CloudentUtils.isTitleFormatTypeValid(type)) {
         this.eventtitleformat = type;
      } else {
         CloudentUtils.logError("Cannot set unkown title format :" + type);
         throw new InvalidTitleFormatTypeException(type);
      }
   }

   public void setReportemail(String reportemail) {
      this.reportemail = reportemail;
   }

   public void setSchedulerMaxHour(int hour) {
      this.scheduler_maxhr = hour;
   }

   public void setSchedulerMinHour(int hour) {
      this.scheduler_minhr = hour;
   }

   public void setSchedulerStartHour(int hour) {
      this.scheduler_starthr = hour;
   }

   public void setSchedulerSlotMins(int hour) {
      this.scheduler_slotmins = hour;
   }

   public void setTheme(String theme) {
      this.theme = theme;
   }

   public void setEmailnotification(boolean emailnotification) {
      this.emailnotification = emailnotification;
   }

   public void setDailyreports(boolean dailyreports) {
      this.dailyreports = dailyreports;
   }

   public void setEmailcontent(String emailcontent) {
      this.emailcontent = emailcontent;
   }

   public void setPrescriptionHeader(String header) {
      this.prescriptionheader = header;
   }

   public void setDentist(Dentist dentist) {
      this.dentist = dentist;
   }

   public String getXML() {
      StringBuffer ans = new StringBuffer();
      return ans.toString();
   }

   public void reset() {
      this.setDailyreports(true);
      this.setEmailcontent("");
      this.setEmailnotification(true);

      try {
         this.setEventTitleFormatType(DEFAULT_USER_EVTITLEFORMAT);
      } catch (Exception var2) {
         ;
      }

      this.setTheme("aristo");
      this.setSchedulerMaxHour(22);
      this.setSchedulerMinHour(6);
      this.setSchedulerStartHour(8);
      this.setSchedulerSlotMins(5);
      this.setPrescriptionHeader("");
      this.setReportemail("");
   }

   static {
      DEFAULT_USER_EVTITLEFORMAT = EventTitleFormatType.SHORT.getValue();
   }
}
Page generated: Oct 19, 2017 2:34:27 PM