Class RightCharColumn
java.lang.Object
io.github.kelsoncm.fwf.columns.AbstractColumn
io.github.kelsoncm.fwf.columns.CharColumn
io.github.kelsoncm.fwf.columns.RightCharColumn
Character column representing a right-aligned, space-padded string.
-
Field Summary
Fields inherited from class AbstractColumn
description, name, size, start -
Constructor Summary
ConstructorsConstructorDescriptionRightCharColumn(String name, int size) Constructs a newRightCharColumnwith a name and size.RightCharColumn(String name, int size, String description) Constructs a newRightCharColumnwith a name, size, and description. -
Method Summary
Methods inherited from class CharColumn
toValueMethods inherited from class AbstractColumn
getDescription, getEnd, getName, getSize, getStart, setStart, validateToStrSize
-
Constructor Details
-
RightCharColumn
-
RightCharColumn
Constructs a newRightCharColumnwith a name and size.- Parameters:
name- the column namesize- the column size in characters
-
-
Method Details
-
toStr
Formats a String or null into a right-aligned, space-padded string of exact column size.- Overrides:
toStrin classCharColumn- Parameters:
value- String or null to format- Returns:
- right-padded string of size
AbstractColumn.getSize() - Throws:
IllegalArgumentException- ifvalueis not a String or exceeds column size
-