Package docking.widgets.table.constraint
Class ColumnTypeMapper<T,M>
java.lang.Object
docking.widgets.table.constraint.ColumnTypeMapper<T,M>
- Type Parameters:
T
- The column type that has no inherentColumnConstraint
for filtering that column type.M
- The column type to map to that already hasColumnConstraint
s defined for that type.
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
AddressBasedLocationColumnTypeMapper
,DataTypeColumnTypeMapper
,DateColumnTypeMapper
,FloatColumnTypeMapper
,NamespaceColumnTypeMapper
,ObjectToStringMapper
,ProgramLocationColumnTypeMapper
,ScalarToLongColumnTypeMapper
,SymbolColumnTypeMapper
ColumnConstraintTypeMappers allows columns of one type be filterable using an existing
ColumnConstraint
for a different type by defining a mapping from the column type to the desired
filter type. To get the benefit of one of these mappers, all that is required is to implement
one of these mappers. The mapper class must be public and it's name must end in "TypeMapper".
For example, if you have a column type of "Person" that holds various information about a person including their age and you want to filter on their age, you could define a ColumnTypeMapper that converts a "Person" to an int. Just by creating such a mapper class, any table with "Person" column types would now be able to filter on a person's age.
In the example above, you created a filter of a single attribute of person. If, however, you
want more than that, you could instead create a new ColumnConstraint
that filters on
more attributes of a Person. See NumberColumnConstraintProvider
for an example
of how to create these ColumnConstraints and their associated editors.
-
Constructor Summary
ModifierConstructorDescriptionprotected
ColumnTypeMapper
(Class<T> sourceType, Class<M> destinationType) -
Method Summary
-
Constructor Details
-
ColumnTypeMapper
public ColumnTypeMapper() -
ColumnTypeMapper
-
-
Method Details
-
toString
-
hashCode
public int hashCode() -
equals
-
convert
Converts an object of type T1 to an object of type T2- Parameters:
value
- the object to convert.- Returns:
- the converted object.
-
getSourceType
Returns the class of the objects that this mapper will convert from.- Returns:
- the class of the objects that this mapper will convert from.
-
getDestinationType
Returns the class of the objects that this mapper will convert to.- Returns:
- the class of the objects that this mapper will convert to.
-