Record Class DrawCommand.Line
java.lang.Object
java.lang.Record
com.botwithus.bot.api.draw.DrawCommand.Line
- All Implemented Interfaces:
DrawCommand, DrawCommand.Primitive
- Enclosing interface:
DrawCommand
public static record DrawCommand.Line(String key, DrawSpace space, DrawStyle style, int x1, int y1, int x2, int y2)
extends Record
implements DrawCommand.Primitive
Straight segment from
(x1, y1) to (x2, y2).-
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.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.intx1()Returns the value of thex1record component.intx2()Returns the value of thex2record component.inty1()Returns the value of they1record component.inty2()Returns the value of they2record component.
-
Constructor Details
-
Line
Creates an instance of aLinerecord class.- Parameters:
key- the value for thekeyrecord componentspace- the value for thespacerecord componentstyle- the value for thestylerecord componentx1- the value for thex1record componenty1- the value for they1record componentx2- the value for thex2record componenty2- the value for they2record 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
-
x1
public int x1()Returns the value of thex1record component.- Returns:
- the value of the
x1record component
-
y1
public int y1()Returns the value of they1record component.- Returns:
- the value of the
y1record component
-
x2
public int x2()Returns the value of thex2record component.- Returns:
- the value of the
x2record component
-
y2
public int y2()Returns the value of they2record component.- Returns:
- the value of the
y2record component
-