Package org.bedework.calfacade.util
Class CalFacadeUtil
java.lang.Object
org.bedework.calfacade.util.CalFacadeUtil
- All Implemented Interfaces:
Serializable
A few helpers.
UID generation copied from hibernate.
- Version:
- 1.0
- Author:
- Mike Douglass douglm - bedework.edu
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>>
intcmpObjval(Collection<T> thisone, Collection<T> thatone) Compare two possibly null objectsstatic <T extends Comparable<T>>
intcmpObjval(T thisone, T thatone) Compare two possibly null objectsstatic intcompareStrings(String s1, String s2) Compare two strings.static booleanCompare two possibly null objects for equalitygetHrefRecurrenceId(String href) static StringgetTimeFromMinutes(int minutes) Turn the int minutes into a 4 digit String hours and minutes valuestatic <T extends BwCloneable>
booleanupdateCollection(boolean cloned, Collection<T> from, Collection<T> to) Update the to Collection with from elements.static <T extends BwCloneable>
booleanupdateCollection(boolean cloned, Collection<T> from, Collection<T> to, Collection<T> added, Collection<T> removed) Update the to Collection with from elements.
-
Method Details
-
getHrefRecurrenceId
-
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 addingfrom- source of elementsto- 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 addingfrom- source of elementsto- where they goadded- - may be null - updated with added entriesremoved- - may be null - updated with removed entries- Returns:
- boolean true if changed
-
compareStrings
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
Compare two possibly null objects for equality- Parameters:
thisone- first objectthatone- second object- Returns:
- boolean true if both null or equal
-
cmpObjval
Compare two possibly null objects- Parameters:
thisone- first objectthatone- second object- Returns:
- int -1, 0, 1,
-
cmpObjval
Compare two possibly null objects- Parameters:
thisone- first objectthatone- second object- Returns:
- int -1, 0, 1,
-
getTimeFromMinutes
Turn the int minutes into a 4 digit String hours and minutes value- Parameters:
minutes- int- Returns:
- String 4 digit hours + minutes
-