Class CollectionPref<T extends Comparable<T>>

java.lang.Object
org.bedework.calfacade.base.DumpEntity<T>
org.bedework.calfacade.svc.prefs.CollectionPref<T>
Type Parameters:
T - Type of element in the collection
All Implemented Interfaces:
Serializable, org.bedework.util.logging.Logged
Direct Known Subclasses:
CalendarPref, CategoryPref, ContactPref, LocationPref

public class CollectionPref<T extends Comparable<T>> extends DumpEntity<T> implements Serializable
Represent a set of user preferences from a Collection - e.g. preferred category.
Version:
1.0
Author:
Mike Douglass douglm - rpi.edu
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bedework.calfacade.base.DumpEntity

    DumpEntity.DumpType
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    If true automatically add preference to the preferred list
    protected Collection<T>
    Users preferred collection.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(T val)
    Add the element to the preferred collection.
     
    boolean
     
    boolean
     
     
    int
     
    boolean
    remove(T val)
    Remove the element from the preferred collection.
    void
    setAutoAdd(boolean val)
    If true we automatically add preference to the preferred list
    void
     
     

    Methods inherited from class org.bedework.calfacade.base.DumpEntity

    dump, dump, getLogger, hasDumpValue

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.bedework.util.logging.Logged

    audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warn
  • Field Details

    • autoAdd

      protected boolean autoAdd
      If true automatically add preference to the preferred list
    • preferred

      protected Collection<T extends Comparable<T>> preferred
      Users preferred collection.
  • Constructor Details

    • CollectionPref

      public CollectionPref()
  • Method Details

    • setAutoAdd

      public void setAutoAdd(boolean val)
      If true we automatically add preference to the preferred list
      Parameters:
      val - true for autoadd
    • getAutoAdd

      public boolean getAutoAdd()
      Returns:
      boolean true if we automatically add preference to the preferred list
    • setPreferred

      public void setPreferred(Collection<T> val)
      Parameters:
      val - Collection of preferred entries
    • getPreferred

      public Collection<T> getPreferred()
      Returns:
      Collection of preferred entries
    • add

      public boolean add(T val)
      Add the element to the preferred collection. Return true if it was added, false if it was in the list
      Parameters:
      val - Element to add
      Returns:
      boolean true if added
    • remove

      public boolean remove(T val)
      Remove the element from the preferred collection. Return true if it was removed, false if it was not in the list
      Parameters:
      val - Element to remove
      Returns:
      boolean true if removed
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Object clone()
      Overrides:
      clone in class Object