Class Schedule

java.lang.Object
com.jbstrap.ui.components.calendar.Schedule

public class Schedule extends Object
Calendar scheduled event, used by the Calendar component
Since:
4.0
Author:
JBStrap
  • Constructor Details

    • Schedule

      public Schedule()
      Creates a calendar scheduled event
  • Method Details

    • setCalendar

      protected Schedule setCalendar(com.jbstrap.ui.components.calendar.CalendarElement calendar)
      Sets the scheduled event's calendar
      Parameters:
      calendar - The instance of the calendar component, which will have schedule set to it
      Returns:
      The Schedule object
    • getEventID

      public String getEventID()
      Gets the unique ID of the scheduled event
      Returns:
      The unique ID of the scheduled event
    • setId

      public Schedule setId(String id)
      Sets the unique ID of the scheduled event
      Parameters:
      id - The unique ID of the scheduled event
      Returns:
      The schedule object
    • getCalendarName

      public String getCalendarName()
      Gets the name of the calendar, that has the scheduled event assigned to it
      Returns:
      The name of the calendar, or null, if it was not specified
    • getCalendar

      protected com.jbstrap.ui.components.calendar.CalendarElement getCalendar()
      Gets the instance of the calendar, that is assigned to the Scheduled event object.
      Returns:
      The calendar instance of the scheduled event, or null if it isn't assigned to any calendar component
    • setTitle

      public Schedule setTitle(String title)
      Sets the title of the scheduled event
      Parameters:
      title - The title of the scheduled event. If null, no title will be used
      Returns:
      The schedule object
    • getTitle

      public String getTitle()
      Gets the title of the scheduled event
      Returns:
      The title or null, if it has none
    • setBody

      public Schedule setBody(String body)
      Sets the body (description) of the scheduled event
      Parameters:
      body - The description of the event. If null, it will not have a description.
      Returns:
      The schedule object
    • getBody

      public String getBody()
      Gets the body (description) of the scheduled event
      Returns:
      The description of the event. Or null, if it has no description.
    • setStartDate

      public Schedule setStartDate(Date startDate)
      Sets the start date of the scheduled event
      Parameters:
      startDate - The start date of the scheduled event
      Returns:
      The schedule object
      Throws:
      NullPointerException - If the start date is null
    • getStartDate

      public Date getStartDate()
      Gets the start date of the scheduled event
      Returns:
      The starting date of the scheduled event or null, if it has none
    • setEndDate

      public Schedule setEndDate(Date endDate)
      Sets the end date of the scheduled event
      Parameters:
      endDate - The end date of the scheduled event
      Returns:
      The schedule object
      Throws:
      NullPointerException - If the end date is null
    • getEndDate

      public Date getEndDate()
      Gets the end date of the scheduled event
      Returns:
      The ending date of the scheduled event or null, if it has none
    • setComingDuration

      public Schedule setComingDuration(Long duration)
      Sets the coming duration (the amount of times it takes to come back from the event)
      Parameters:
      duration - The duration, in minutes
      Returns:
      The schedule object
    • getComingDuration

      public Long getComingDuration()
      Gets the coming duration (the amount of times it takes to come back from the event)
      Returns:
      The duration, in minutes, or null if it was not specified
    • setGoingDuration

      public Schedule setGoingDuration(Long duration)
      Sets the going duration (the amount of times it takes to go to the event)
      Parameters:
      duration - The duration, in minutes
      Returns:
      The schedule object
    • getGoingDuration

      public Long getGoingDuration()
      Gets the going duration (the amount of times it takes to go to the event)
      Returns:
      The duration, in minutes, or null if it was not specified
    • setType

      public Schedule setType(ScheduleType type)
      Sets the type of the scheduled event
      Parameters:
      type - The event type. The usable values can be found in the ScheduleType enum.
      Returns:
      The schedule object
      Throws:
      NullPointerException - If the type is null
    • getType

      public ScheduleType getType()
      Gets the type of the scheduled event
      Returns:
      The event type or null if it was not specified
    • isAllDay

      public boolean isAllDay()
      Determines if the scheduled event is an all-day event.
      Returns:
      If true, it is, otherwise not.
    • setLocation

      public Schedule setLocation(String location)
      Sets the location of the scheduled event
      Parameters:
      location - The location of the event
      Returns:
      The schedule object
    • getLocation

      public String getLocation()
      Gets the location of the scheduled event
      Returns:
      The location or null if not specified
    • addAttendee

      public Schedule addAttendee(String attendee)
      Adds an attendee to the scheduled event
      Parameters:
      attendee - The new attendee
      Returns:
      The schedule object
    • addAttendees

      public Schedule addAttendees(String... attendees)
      Adds multiple attendees to the scheduled event
      Parameters:
      attendees - The new attendees
      Returns:
      The schedule object
    • removeAttendee

      public Schedule removeAttendee(String attendee)
      Removes an attendee from the scheduled event
      Parameters:
      attendee - The attendee to be removed
      Returns:
      The schedule object
    • removeAllAttendees

      public Schedule removeAllAttendees()
      Removes every attendee from the scheduled event
      Returns:
      The schedule object
    • getAttendees

      public List<String> getAttendees()
      Gets a list of the attendees
      Returns:
      A list containing every attendee, or null, if no attendees were specified
    • setPending

      public Schedule setPending(boolean pending)
      Sets the scheduled event as pending. By default, it is not.
      Parameters:
      pending - If true, the scheduled event will be marked as pending
      Returns:
      The schedule object
    • isPending

      public boolean isPending()
      Determines if the scheduled event is pending.
      Returns:
      If true, the event is pending.
    • setReadOnly

      public Schedule setReadOnly(boolean readOnly)
      Sets the scheduled event as read-only. By default, this is false, meaning that the user can modify/move it.
      Parameters:
      readOnly - If true the scheduled event is read-only.
      Returns:
      The schedule object
    • isReadOnly

      public boolean isReadOnly()
      Determines if the scheduled event is read-only
      Returns:
      If true, the scheduled event is read-only
    • setPrivate

      public Schedule setPrivate(boolean privateFlag)
      Sets the scheduled event as private. By default, the event is not private.
      Parameters:
      privateFlag - If true, the scheduled event is marked as private, otherwise not
      Returns:
      The schedule object
    • isPrivate

      public boolean isPrivate()
      Determines if the scheduled event is private.
      Returns:
      If true, the scheduled event is marked as private, otherwise not
    • setVisible

      public Schedule setVisible(boolean visible)
      Sets if the scheduled event is visible. By default it is visible.
      Parameters:
      visible - If true, the scheduled event is visible on the component. If false it will not be displayed
      Returns:
      The schedule object
    • isVisible

      public boolean isVisible()
      Determines if the scheduled event is visible.
      Returns:
      If true, the scheduled event is visible on the component
    • setRecord

      protected Schedule setRecord(Record record)
      Sets the Scheduled Event's database record
      Parameters:
      record - The database record
      Returns:
      The schedule object
    • getRecord

      public Record getRecord()
      Gets the scheduled event's database record
      Returns:
      The record, or null, if it was not set