Record Class DrawStyle

java.lang.Object
java.lang.Record
com.botwithus.bot.api.draw.DrawStyle
Record Components:
color - packed 0xAARRGGBB; see Colors
thickness - stroke width, DrawLimits.MIN_THICKNESS to DrawLimits.MAX_THICKNESS
isFilled - fill rather than stroke; meaningful for rect, ellipse and poly
isClosed - close the loop back to the first point; meaningful for poly only
z - draw order, higher in front
ttlMs - lifetime in milliseconds, or DrawLimits.TTL_UNTIL_CLEARED

public record DrawStyle(int color, int thickness, boolean isFilled, boolean isClosed, int z, long ttlMs) extends Record
The presentation half of a draw command — everything that is not geometry.

Built by DrawBuilder; a script rarely constructs one directly. ttlMs() is always populated and always goes on the wire, so the lifetime a command actually got is a value you can read back rather than an invisible producer-side default.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final DrawStyle
    The style a builder starts from: opaque green, hairline, the producer's default TTL.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DrawStyle(int color, int thickness, boolean isFilled, boolean isClosed, int z, long ttlMs)
    Creates an instance of a DrawStyle record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the color record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the isClosed record component.
    boolean
    Returns the value of the isFilled record component.
    int
    Returns the value of the thickness record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the ttlMs record component.
    int
    z()
    Returns the value of the z record component.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT

      public static final DrawStyle DEFAULT
      The style a builder starts from: opaque green, hairline, the producer's default TTL.
  • Constructor Details

    • DrawStyle

      public DrawStyle(int color, int thickness, boolean isFilled, boolean isClosed, int z, long ttlMs)
      Creates an instance of a DrawStyle record class.
      Parameters:
      color - the value for the color record component
      thickness - the value for the thickness record component
      isFilled - the value for the isFilled record component
      isClosed - the value for the isClosed record component
      z - the value for the z record component
      ttlMs - the value for the ttlMs record component
  • Method Details

    • 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 the compare method from their corresponding wrapper classes.
      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.
    • color

      public int color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • thickness

      public int thickness()
      Returns the value of the thickness record component.
      Returns:
      the value of the thickness record component
    • isFilled

      public boolean isFilled()
      Returns the value of the isFilled record component.
      Returns:
      the value of the isFilled record component
    • isClosed

      public boolean isClosed()
      Returns the value of the isClosed record component.
      Returns:
      the value of the isClosed record component
    • z

      public int z()
      Returns the value of the z record component.
      Returns:
      the value of the z record component
    • ttlMs

      public long ttlMs()
      Returns the value of the ttlMs record component.
      Returns:
      the value of the ttlMs record component