FormattedString

class FormattedString(val contents: List<FormattedStringObject>, isBold: Boolean? = null, isItalic: Boolean? = null, isUnderlined: Boolean? = null, isStrikethrough: Boolean? = null, isInverted: Boolean? = null, val color: Formatting.FGColor? = null, val backgroundColor: Formatting.BGColor? = null) : FormattedStringObject(source)

A formatted String that can be used to format Strings with colors and styles

Since

0.1.1

Parameters

contents

the FormattedStringObjects that are wrapped in this FormattedString

isBold

if the FormattedString is bold

isItalic

if the FormattedString is italic

isUnderlined

if the FormattedString is underlined

isStrikethrough

if the FormattedString is strikethrough

isInverted

if the FormattedString is inverted

backgroundColor

Constructors

Link copied to clipboard
constructor(contents: FormattedString, strings: List<FormattedStringObject> = contents.contents, isBold: Boolean? = contents.isBold, isItalic: Boolean? = contents.isItalic, isUnderlined: Boolean? = contents.isUnderlined, isStrikethrough: Boolean? = contents.isStrikethrough, isInverted: Boolean? = contents.isInverted, color: Formatting.FGColor? = contents.color, backgroundColor: Formatting.BGColor? = contents.backgroundColor)
constructor(contents: List<FormattedStringObject>, isBold: Boolean? = null, isItalic: Boolean? = null, isUnderlined: Boolean? = null, isStrikethrough: Boolean? = null, isInverted: Boolean? = null, color: Formatting.FGColor? = null, backgroundColor: Formatting.BGColor? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val formatsItself: Boolean
Link copied to clipboard

If the FormattedString is bold

Link copied to clipboard

Is the FormattedString formatted in any way? (Used to determine if the generated String should be formatted and if the Formatting.RESET should be added)

Link copied to clipboard

If the FormattedString is inverted

Link copied to clipboard

If the FormattedString is italic

Link copied to clipboard

If the FormattedString is strikethrough

Link copied to clipboard

If the FormattedString is underlined

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Make this FormattedString bold

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun extends(format: FormattedString): FormattedString

Extend this FormattedString with the given format

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Make this FormattedString inverted

Link copied to clipboard

Make this FormattedString italic

Link copied to clipboard
operator fun plus(other: String): FormattedString
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extend this FormattedString with the given format

Link copied to clipboard

Make this FormattedString strikethrough

Link copied to clipboard
open fun string(): String

Get the String representation of this FormattedStringObject (Basically a shortcut for toString) Not needed to be overridden

Link copied to clipboard
open override fun toString(): String

Get the String representation of this FormattedString

Link copied to clipboard

Make this FormattedString underlined

Link copied to clipboard
Link copied to clipboard