Class ColumnPreviewManager
java.lang.Object
com.illumon.iris.db.tables.remote.preview.ColumnPreviewManager
public class ColumnPreviewManager extends Object
Converts large data types to Preview types. Also wraps non-serializable data types to be serializable.
-
Constructor Summary
Constructors Constructor Description ColumnPreviewManager()
-
Method Summary
Modifier and Type Method Description static <S, D extends PreviewType>
voidaddPreview(Class<S> sourceType, Class<D> destType, Function<S,D> function)
Adds a data type to be converted to a Preview Type.static Table
applyPreview(Table table)
Iterates over a tables columns and applies a preview (or wraps non-serializable).static boolean
isColumnTypeDisplayable(Class<?> type)
Indicates if a column type is displayable by the client.static boolean
isOnWhiteList(Class<?> type)
Indicates if a type is on the white list created from user defined properties.
-
Constructor Details
-
ColumnPreviewManager
public ColumnPreviewManager()
-
-
Method Details
-
addPreview
public static <S, D extends PreviewType> void addPreview(Class<S> sourceType, Class<D> destType, Function<S,D> function)Adds a data type to be converted to a Preview Type.- Type Parameters:
S
- the source typeD
- the destination type- Parameters:
sourceType
- the type to convertdestType
- the Preview type to convert tofunction
- the function that applies the conversion
-
applyPreview
Iterates over a tables columns and applies a preview (or wraps non-serializable).- Parameters:
table
- the table to apply the preview- Returns:
- the table containing the preview columns
-
isColumnTypeDisplayable
Indicates if a column type is displayable by the client. This is used to screen out unknown classes, unserializable, and anything else that should not be displayed.- Parameters:
type
- the column type- Returns:
- true if the type can be displayed by the client, false otherwise.
-
isOnWhiteList
Indicates if a type is on the white list created from user defined properties.- Parameters:
type
- the class type- Returns:
- true if it is on the white list, false otherwise
-