Record Class DrawCommand.Rect
java.lang.Object
java.lang.Record
com.botwithus.bot.api.draw.DrawCommand.Rect
- All Implemented Interfaces:
DrawCommand, DrawCommand.Primitive
- Enclosing interface:
DrawCommand
public static record DrawCommand.Rect(String key, DrawSpace space, DrawStyle style, int x, int y, int w, int h)
extends Record
implements DrawCommand.Primitive
Axis-aligned rectangle, stroked or filled per
DrawStyle.isFilled().-
Nested Class Summary
Nested classes/interfaces inherited from interface DrawCommand
DrawCommand.Area, DrawCommand.ComponentTarget, DrawCommand.Ellipse, DrawCommand.Entity, DrawCommand.Highlight, DrawCommand.Line, DrawCommand.Poly, DrawCommand.Primitive, DrawCommand.Rect, DrawCommand.Text, DrawCommand.Tile -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.inth()Returns the value of thehrecord component.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.kind()The primitive this command draws.space()Returns the value of thespacerecord component.style()Returns the value of thestylerecord component.final StringtoString()Returns a string representation of this record class.intw()Returns the value of thewrecord component.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.
-
Constructor Details
-
Rect
Creates an instance of aRectrecord class.- Parameters:
key- the value for thekeyrecord componentspace- the value for thespacerecord componentstyle- the value for thestylerecord componentx- the value for thexrecord componenty- the value for theyrecord componentw- the value for thewrecord componenth- the value for thehrecord component
-
-
Method Details
-
kind
Description copied from interface:DrawCommandThe primitive this command draws.- Specified by:
kindin interfaceDrawCommand
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
Returns the value of thekeyrecord component.- Specified by:
keyin interfaceDrawCommand- Returns:
- the value of the
keyrecord component
-
space
Returns the value of thespacerecord component.- Specified by:
spacein interfaceDrawCommand- Returns:
- the value of the
spacerecord component
-
style
Returns the value of thestylerecord component.- Specified by:
stylein interfaceDrawCommand- Returns:
- the value of the
stylerecord component
-
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
w
public int w()Returns the value of thewrecord component.- Returns:
- the value of the
wrecord component
-
h
public int h()Returns the value of thehrecord component.- Returns:
- the value of the
hrecord component
-