public class TableHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
assertSupported(java.lang.Class<? extends java.io.Serializable> valueType)
Helper function throwing a
TableException if given value type is not supported by YouScope, and doing nothing otherwise. |
static <T extends java.io.Serializable> |
createEntry(java.lang.Class<T> valueType,
T value,
boolean nullAllowed)
Creates a table entry containing the given value.
|
static java.lang.Iterable<java.lang.Class<? extends java.io.Serializable>> |
getSupportedValueTypes()
Returns all currently supported value types of YouScope.
|
static boolean |
isSupportedValueType(java.lang.Class<? extends java.io.Serializable> valueType)
Checks if the given value type is supported by YouScope.
|
public static <T extends java.io.Serializable> org.youscope.common.table.TableEntryAdapter<T> createEntry(java.lang.Class<T> valueType, T value, boolean nullAllowed) throws TableException, java.lang.NullPointerException
value
- The value for which an entry containing the value should be constructed.valueType
- The precise value type of the entry, that is, one of the value types returned by getSupportedValueTypes()
.nullAllowed
- indicating if assigning null to the returned table entry is allowed or not.TableException
- Thrown if entry could not be constructed, e.g. if value type was invalid.java.lang.NullPointerException
- Thrown if valueType is null.public static java.lang.Iterable<java.lang.Class<? extends java.io.Serializable>> getSupportedValueTypes()
Object.getClass()
is different from int.class()
,
and that the former is supported only.public static boolean isSupportedValueType(java.lang.Class<? extends java.io.Serializable> valueType)
valueType
- The value type to check for support.public static void assertSupported(java.lang.Class<? extends java.io.Serializable> valueType) throws TableException
TableException
if given value type is not supported by YouScope, and doing nothing otherwise.
See isSupportedValueType(Class)
.
Currently, YouScope only supports a limited set of value types for tables. See getSupportedValueTypes()
for the list of supported value types.valueType
- Value type to check.TableException
- Thrown if value type is not supported.