Record Class CalendarCollection

java.lang.Object
java.lang.Record
org.exoplatform.caldav.client.CalendarCollection

public record CalendarCollection(String href, String displayName, String ctag, String syncToken, String color, boolean writable, Set<String> components) extends Record
  • Constructor Details

    • CalendarCollection

      public CalendarCollection(String href, String displayName, String ctag, String syncToken, String color, boolean writable)
      A collection whose server declared no component set.

      The six-argument form every caller used before the set was read: an undeclared set is an empty one, which holdsEvents() reads as "the server did not say" — the RFC 4791 default of supporting everything.

      Parameters:
      href - the collection path
      displayName - the name the server gives it
      ctag - the collection change tag
      syncToken - the RFC 6578 sync token
      color - the colour the server carries
      writable - whether the caller may write to it
    • CalendarCollection

      public CalendarCollection(String href, String displayName, String ctag, String syncToken, String color, boolean writable, Set<String> components)
      Creates an instance of a CalendarCollection record class.
      Parameters:
      href - the value for the href record component
      displayName - the value for the displayName record component
      ctag - the value for the ctag record component
      syncToken - the value for the syncToken record component
      color - the value for the color record component
      writable - the value for the writable record component
      components - the value for the components record component
  • Method Details

    • holdsEvents

      public boolean holdsEvents()
      Whether this collection holds events at all.

      RFC 4791 §5.2.3 makes supported-calendar-component-set optional, and a collection that omits it supports every component. An empty set is therefore a server that did not say, not a server that said "nothing" — both answer true. Only an explicit set without VEVENT answers false, which is what keeps a task list from becoming a calendar.

      Returns:
      true unless the server explicitly excluded events
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • href

      public String href()
      Returns the value of the href record component.
      Returns:
      the value of the href record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • ctag

      public String ctag()
      Returns the value of the ctag record component.
      Returns:
      the value of the ctag record component
    • syncToken

      public String syncToken()
      Returns the value of the syncToken record component.
      Returns:
      the value of the syncToken record component
    • color

      public String color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • writable

      public boolean writable()
      Returns the value of the writable record component.
      Returns:
      the value of the writable record component
    • components

      public Set<String> components()
      Returns the value of the components record component.
      Returns:
      the value of the components record component