Class FunctionPropertyAdapter<T>
- java.lang.Object
-
- io.github.jonestimd.swing.table.model.FunctionPropertyAdapter<T>
-
- Type Parameters:
T
- the class of the property value
- All Implemented Interfaces:
PropertyAdapter<T>
public class FunctionPropertyAdapter<T> extends java.lang.Object implements PropertyAdapter<T>
A property adapter based on functions (or method references).- See Also:
TableSummary
,TableSummaryPanel
-
-
Constructor Summary
Constructors Constructor Description FunctionPropertyAdapter(java.lang.String name, java.lang.String label, java.util.function.Supplier<T> getter, java.util.function.Supplier<java.text.Format> formatFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.text.Format
getFormat()
java.lang.String
getLabel()
java.lang.String
getName()
T
getValue()
-
-
-
Constructor Detail
-
FunctionPropertyAdapter
public FunctionPropertyAdapter(java.lang.String name, java.lang.String label, java.util.function.Supplier<T> getter, java.util.function.Supplier<java.text.Format> formatFactory)
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfacePropertyAdapter<T>
- Returns:
- the property name used in
PropertyChangeEvent
s.
-
getLabel
public java.lang.String getLabel()
- Specified by:
getLabel
in interfacePropertyAdapter<T>
- Returns:
- the label for the UI element.
-
getValue
public T getValue()
- Specified by:
getValue
in interfacePropertyAdapter<T>
- Returns:
- the property value.
-
getFormat
public java.text.Format getFormat()
- Specified by:
getFormat
in interfacePropertyAdapter<T>
- Returns:
- a formatter for converting the value to a
String
.
-
-