public interface ValueProvider extends Serializable
Modifier and Type | Interface and Description |
---|---|
static class |
ValueProvider.AbstractValueProvider
Extend this to get basic value provider functionality out of the box - return class, comparator and memoization.
|
static class |
ValueProvider.DelegatingValueProvider
Decorator pattern - delegates all calls to delegate.
|
static class |
ValueProvider.LocalizingValueProvider
Localizes values provided by the underlying value provider.
|
static class |
ValueProvider.MemoizingValueProvider
A provider which caches (memoizes) pairs of input-result, as provided by the delegate, indefinitely.
|
static class |
ValueProvider.ToStringValueProvider
Simply converts row objects to string, by calling
Object.toString() . |
static class |
ValueProvider.ValueKeepingValueProvider
Hold and keeps value independently of row object.
|
Modifier and Type | Method and Description |
---|---|
Object |
call(Object input)
Provides value for given row data object.
|
com.google.common.collect.Ordering<Object> |
getComparator()
Returns comparator which compares input objects based on values provided by this value provider.
|
RecordHolder |
getDefinition()
Gets the LSPS object counterpart of this value provider.
|
Class<?> |
getReturnJavaClass(Namespace namespace)
Java class of objects provided by
call(Object) . |
Type |
getValueType(Namespace namespace)
Returns the value type provided by this provider (by calls to
call(Object) . |
ValueProvider |
memoize()
Returns a value provider which caches (memoizes) pairs of input-result of
call(Object) indefinitely. |
RecordHolder getDefinition()
Class<?> getReturnJavaClass(Namespace namespace)
call(Object)
. If in doubt, return Object.class
.namespace
- calling namespace, not null.Type getValueType(Namespace namespace)
call(Object)
. When in doubt, return SimpleType.OBJECT
.namespace
- calling namespace, not null.Object call(Object input)
input
- the input object, mostly RecordHolder, may be null.com.google.common.collect.Ordering<Object> getComparator()
call(Object)
must be Comparable!call(Object)
on every input object and sorts the objects by comparing output values.
Never null.ValueProvider memoize()
call(Object)
indefinitely.Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.