Class CalFacadeUtil

java.lang.Object
org.bedework.calfacade.util.CalFacadeUtil
All Implemented Interfaces:
Serializable

public class CalFacadeUtil extends Object implements Serializable
A few helpers. UID generation copied from hibernate.
Version:
1.0
Author:
Mike Douglass douglm - bedework.edu
See Also:
  • Method Details

    • getHrefRecurrenceId

      public static CalFacadeUtil.HrefRecurrenceId getHrefRecurrenceId(String href)
    • updateCollection

      public static <T extends BwCloneable> boolean updateCollection(boolean cloned, Collection<T> from, Collection<T> to)
      Update the to Collection with from elements. This is used to add or remove members from a Collection managed by hibernate for example where a replacement of the Collection is not allowed.
      Type Parameters:
      T - class of Collections
      Parameters:
      cloned - - true if we must clone entities before adding
      from - source of elements
      to - where they go
      Returns:
      boolean true if changed
    • updateCollection

      public static <T extends BwCloneable> boolean updateCollection(boolean cloned, Collection<T> from, Collection<T> to, Collection<T> added, Collection<T> removed)
      Update the to Collection with from elements. This is used to add or remove members from a Collection managed by hibernate for example where a replacement of the Collection is not allowed.
      Type Parameters:
      T - class of Collections
      Parameters:
      cloned - - true if we must clone entities before adding
      from - source of elements
      to - where they go
      added - - may be null - updated with added entries
      removed - - may be null - updated with removed entries
      Returns:
      boolean true if changed
    • compareStrings

      public static int compareStrings(String s1, String s2)
      Compare two strings. null is less than any non-null string.
      Parameters:
      s1 - first string.
      s2 - second string.
      Returns:
      int 0 if the s1 is equal to s2; <0 if s1 is lexicographically less than s2; >0 if s1 is lexicographically greater than s2.
    • eqObjval

      public static boolean eqObjval(Object thisone, Object thatone)
      Compare two possibly null objects for equality
      Parameters:
      thisone - first object
      thatone - second object
      Returns:
      boolean true if both null or equal
    • cmpObjval

      public static <T extends Comparable<T>> int cmpObjval(T thisone, T thatone)
      Compare two possibly null objects
      Parameters:
      thisone - first object
      thatone - second object
      Returns:
      int -1, 0, 1,
    • cmpObjval

      public static <T extends Comparable<T>> int cmpObjval(Collection<T> thisone, Collection<T> thatone)
      Compare two possibly null objects
      Parameters:
      thisone - first object
      thatone - second object
      Returns:
      int -1, 0, 1,
    • getTimeFromMinutes

      public static String getTimeFromMinutes(int minutes)
      Turn the int minutes into a 4 digit String hours and minutes value
      Parameters:
      minutes - int
      Returns:
      String 4 digit hours + minutes