Record Class DrawCommand.Text
java.lang.Object
java.lang.Record
com.botwithus.bot.api.draw.DrawCommand.Text
- All Implemented Interfaces:
DrawCommand, DrawCommand.Primitive
- Enclosing interface:
DrawCommand
public static record DrawCommand.Text(String key, DrawSpace space, DrawStyle style, int x, int y, DrawCaption caption)
extends Record
implements DrawCommand.Primitive
A caption anchored at
(x, y).
The caption is required here — a text command that draws nothing is not
a thing worth sending. It may be literal text or a fixed-point number; see
DrawCaption.
-
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
ConstructorsConstructorDescriptionText(String key, DrawSpace space, DrawStyle style, int x, int y, DrawCaption caption) Creates an instance of aTextrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncaption()Returns the value of thecaptionrecord component.final 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.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.
-
Constructor Details
-
Text
Creates an instance of aTextrecord 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 componentcaption- the value for thecaptionrecord 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
-
caption
Returns the value of thecaptionrecord component.- Returns:
- the value of the
captionrecord component
-