Package io.keikai.axyra.sheets
Record Class FindFormat
java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.FindFormat
public record FindFormat(Color fillColor, Color fontColor, Boolean bold, Boolean italic, String numberFormat)
extends Record
A style predicate for format-restricted find/replace (Excel's Find &
Replace → Format... filter) — see
Sheet.find(String, FindFormat) and
Sheet.replaceAll(String, String, FindFormat).
Matching semantics. Only the fields that are set (non-null)
participate; every set field must equal the corresponding component of the
cell's resolved style. A cell without an explicit style resolves to
the workbook default style, so e.g. withBold(false) matches
unstyled cells. Colors compare by RGB value only and must be
RGB colors — a cell whose color is a
theme/indexed/automatic reference never matches a color field.
numberFormat compares the resolved number format code (an
unformatted cell resolves to "General").
Build with the empty of() filter and the withX copies:
FindFormat.of().withBold(true).withFillColor(Color.YELLOW).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbold()Returns the value of theboldrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefillColorrecord component.Returns the value of thefontColorrecord component.final inthashCode()Returns a hash code value for this object.booleanisEmpty()Whether no criterion is set.italic()Returns the value of theitalicrecord component.Returns the value of thenumberFormatrecord component.static FindFormatof()The empty filter (no criteria — combine withwithXmethods).final StringtoString()Returns a string representation of this record class.withBold(boolean b) A copy matching cells whose font bold flag equalsb.A copy matching cells whose fill foreground (pattern) color equalsc.A copy matching cells whose font color equalsc.withItalic(boolean i) A copy matching cells whose font italic flag equalsi.withNumberFormat(String code) A copy matching cells whose resolved number format code equalscode(e.g.
-
Constructor Details
-
FindFormat
public FindFormat(Color fillColor, Color fontColor, Boolean bold, Boolean italic, String numberFormat) Creates an instance of aFindFormatrecord class.- Parameters:
fillColor- the value for thefillColorrecord componentfontColor- the value for thefontColorrecord componentbold- the value for theboldrecord componentitalic- the value for theitalicrecord componentnumberFormat- the value for thenumberFormatrecord component
-
-
Method Details
-
of
The empty filter (no criteria — combine withwithXmethods). -
withFillColor
A copy matching cells whose fill foreground (pattern) color equalsc. -
withFontColor
A copy matching cells whose font color equalsc. -
withBold
A copy matching cells whose font bold flag equalsb. -
withItalic
A copy matching cells whose font italic flag equalsi. -
withNumberFormat
A copy matching cells whose resolved number format code equalscode(e.g."0.00"; unformatted cells resolve to"General"). -
isEmpty
public boolean isEmpty()Whether no criterion is set. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
fillColor
Returns the value of thefillColorrecord component.- Returns:
- the value of the
fillColorrecord component
-
fontColor
Returns the value of thefontColorrecord component.- Returns:
- the value of the
fontColorrecord component
-
bold
Returns the value of theboldrecord component.- Returns:
- the value of the
boldrecord component
-
italic
Returns the value of theitalicrecord component.- Returns:
- the value of the
italicrecord component
-
numberFormat
Returns the value of thenumberFormatrecord component.- Returns:
- the value of the
numberFormatrecord component
-