Record Class RowedFormatter<T>
java.lang.Object
java.lang.Record
eu.cloudnetservice.utils.base.column.RowedFormatter<T>
- Type Parameters:
T- the type of element converted to a table by this formatter- Record Components:
defaultFormatter- the default formatter to use to turn the formatted rows into a table.columns- the column level data extractors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder that can be used to construct a new row based formatter. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thecolumnsrecord component.private final @NonNull ColumnFormatterThe field for thedefaultFormatterrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRowedFormatter(@NonNull ColumnFormatter defaultFormatter, @NonNull List<Function<T, Object>> columns) Creates an instance of aRowedFormatterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NonNull RowedFormatter.Builder<T> builder()Constructs a new builder for a rowed formatter.columns()Returns the value of thecolumnsrecord component.convertToColumns(@NonNull Collection<T> input) Converts the given input data into columns to prepare them to be converted into a table.convertToColumns(T... input) Converts the given input data into columns to prepare them to be converted into a table.Returns the value of thedefaultFormatterrecord component.final booleanIndicates whether some other object is "equal to" this one.format(@NonNull Collection<T> input) Converts the given input data into a formatted table using the default formatter given to this formatter.Converts the given input data into a formatted table using the default formatter given to this formatter.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
defaultFormatter
The field for thedefaultFormatterrecord component. -
columns
-
-
Constructor Details
-
RowedFormatter
public RowedFormatter(@NonNull @NonNull ColumnFormatter defaultFormatter, @NonNull @NonNull List<Function<T, Object>> columns) Creates an instance of aRowedFormatterrecord class.- Parameters:
defaultFormatter- the value for thedefaultFormatterrecord componentcolumns- the value for thecolumnsrecord component
-
-
Method Details
-
builder
Constructs a new builder for a rowed formatter.- Type Parameters:
T- the type of elements that will be handled by the rowed formatter.- Returns:
- a new builder for a rowed formatter.
-
convertToColumns
Converts the given input data into columns to prepare them to be converted into a table.- Parameters:
input- the input data to parse and convert into columns.- Returns:
- the prepared columns based on the given input data.
- Throws:
NullPointerException- if the given input data is null.
-
convertToColumns
Converts the given input data into columns to prepare them to be converted into a table.- Parameters:
input- the input data to parse and convert into columns.- Returns:
- the prepared columns based on the given input data.
- Throws:
NullPointerException- if the given input data is null.
-
format
Converts the given input data into a formatted table using the default formatter given to this formatter.- Parameters:
input- the input data to parse and convert into a table.- Returns:
- the formatted table based on the given input data.
- Throws:
NullPointerException- if the given input data is null.
-
format
Converts the given input data into a formatted table using the default formatter given to this formatter.- Parameters:
input- the input data to parse and convert into a table.- Returns:
- the formatted table based on the given input data.
- Throws:
NullPointerException- if the given input data is null.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
defaultFormatter
Returns the value of thedefaultFormatterrecord component.- Returns:
- the value of the
defaultFormatterrecord component
-
columns
-