Record Class BorderEdge

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.style.BorderEdge
Record Components:
style - the line style; BorderStyle.NONE when no line is drawn
color - the line color; see above for when it is null

public record BorderEdge(BorderStyle style, Color color) extends Record
One border edge read back from a CellStyle with CellStyle.border(Side): the line style and its color. style is BorderStyle.NONE for an absent edge.

On a style read from a cell, color is never null: an edge without an explicit color, including an absent edge, reads Color.auto(). color is null only on a style built with CellStyle.builder() that never set this edge. Test isPresent(), not the color, to see whether a line is drawn.

  • Constructor Details

    • BorderEdge

      public BorderEdge(BorderStyle style, Color color)
      Creates an instance of a BorderEdge record class.
      Parameters:
      style - the value for the style record component
      color - the value for the color record component
  • Method Details

    • isPresent

      public boolean isPresent()
      Whether this edge draws a line, i.e. its style is not BorderStyle.NONE.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • style

      public BorderStyle style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • color

      public Color color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component