Package org.bedework.util.calendar.diff
Class ValueMatcher
- java.lang.Object
-
- org.bedework.util.calendar.diff.ValueMatcher
-
public class ValueMatcher extends Object
This class allows comparison of calendaring values. Each value is represented by an iCalendar value-type element (e.g. text, integer). They can be added to the ValueMatcher object and then that object can be compared to another to determine if the values are equal.- Author:
- Mike Douglass
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceValueMatcher.ValueConverter<T>
-
Constructor Summary
Constructors Constructor Description ValueMatcher()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ValueComparatorgetComparator(T val)ObjectgetElementAndValue(Object val)Called to get a property or parameter object containing only the value.ListgetNormalized(Object val)static voidregisterGlobalConverter(Class cl, ValueMatcher.ValueConverter vc)Register a converter used by all instances of the value matcher.voidregisterInstanceConverter(Class<?> cl, ValueMatcher.ValueConverter<?> vc)Register a converter used only by this instance of the value matcher.
-
-
-
Method Detail
-
getComparator
public <T> ValueComparator getComparator(T val)
- Parameters:
val- - value to match- Returns:
- comparator
-
getElementAndValue
public Object getElementAndValue(Object val)
Called to get a property or parameter object containing only the value. The property or parameter object is a new instance. Its value is copied.- Parameters:
val-- Returns:
- property object containing value only
-
getNormalized
public List getNormalized(Object val)
- Parameters:
val-- Returns:
- normalized set of objects
-
registerGlobalConverter
public static void registerGlobalConverter(Class cl, ValueMatcher.ValueConverter vc)
Register a converter used by all instances of the value matcher.- Parameters:
cl-vc-
-
registerInstanceConverter
public void registerInstanceConverter(Class<?> cl, ValueMatcher.ValueConverter<?> vc)
Register a converter used only by this instance of the value matcher.- Parameters:
cl-vc-
-
-