Package com.destroystokyo.paper

# Class Title.Builder

java.lang.Object
com.destroystokyo.paper.Title.Builder

Enclosing class:
  Title

public static final class Title.Builder extends Object
A builder for creating titles

## Constructor Summary

Constructors
Constructor
Description
`Builder()`

## Method Summary

Modifier and Type
Method
Description
`@NotNull Title`
`build()`
Create a title based on the values in the builder.
`@NotNull Title.Builder`
`fadeIn(int fadeIn)`
Sets the number of ticks for the title to fade in
`@NotNull Title.Builder`
`fadeOut(int fadeOut)`
Sets the number of ticks for the title to fade out.
`@NotNull Title.Builder`
`stay(int stay)`
Sets the number of ticks for the title to stay.
`@NotNull Title.Builder`
`subtitle(@Nullable String subtitle)`
Sets the subtitle to the given text.
`@NotNull Title.Builder`
`subtitle(@Nullable BaseComponent subtitle)`
Sets the subtitle to the given text.
`@NotNull Title.Builder`
`subtitle(@Nullable BaseComponent[] subtitle)`
Sets the subtitle to the given text.
`@NotNull Title.Builder`
`title(@NotNull String title)`
Sets the title to the given text.
`@NotNull Title.Builder`
`title(@NotNull BaseComponent title)`
Sets the title to the given text.
`@NotNull Title.Builder`
`title(@NotNull BaseComponent[] title)`
Sets the title to the given text.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Builder

public Builder()

## Method Details

### title

@NotNull public @NotNull Title.Builder title(@NotNull @NotNull BaseComponent title)
Sets the title to the given text.

Parameters:
  `title` - the title text
Returns:
  this builder instance
Throws:
  `NullPointerException` - if the title is null

### title

@NotNull public @NotNull Title.Builder title(@NotNull @NotNull BaseComponent[] title)
Sets the title to the given text.

Parameters:
  `title` - the title text
Returns:
  this builder instance
Throws:
  `NullPointerException` - if the title is null

### title

@NotNull public @NotNull Title.Builder title(@NotNull @NotNull String title)
Sets the title to the given text.

It is recommended to the `BaseComponent` methods.

Parameters:
  `title` - the title text
Returns:
  this builder instance
Throws:
  `NullPointerException` - if the title is null

### subtitle

@NotNull public @NotNull Title.Builder subtitle(@Nullable @Nullable BaseComponent subtitle)
Sets the subtitle to the given text.

Parameters:
  `subtitle` - the title text
Returns:
  this builder instance

### subtitle

@NotNull public @NotNull Title.Builder subtitle(@Nullable @Nullable BaseComponent[] subtitle)
Sets the subtitle to the given text.

Parameters:
  `subtitle` - the title text
Returns:
  this builder instance

### subtitle

@NotNull public @NotNull Title.Builder subtitle(@Nullable @Nullable String subtitle)
Sets the subtitle to the given text.

It is recommended to the `BaseComponent` methods.

Parameters:
  `subtitle` - the title text
Returns:
  this builder instance

### fadeIn

@NotNull public @NotNull Title.Builder fadeIn(int fadeIn)
Sets the number of ticks for the title to fade in

Parameters:
  `fadeIn` - the number of ticks to fade in
Returns:
  this builder instance
Throws:
  `IllegalArgumentException` - if it is negative

### stay

@NotNull public @NotNull Title.Builder stay(int stay)
Sets the number of ticks for the title to stay.

Parameters:
  `stay` - the number of ticks to stay
Returns:
  this builder instance
Throws:
  `IllegalArgumentException` - if it is negative

### fadeOut

@NotNull public @NotNull Title.Builder fadeOut(int fadeOut)
Sets the number of ticks for the title to fade out.

Parameters:
  `fadeOut` - the number of ticks to fade out
Returns:
  this builder instance
Throws:
  `IllegalArgumentException` - if it is negative

### build

@NotNull public @NotNull Title build()
Create a title based on the values in the builder.

Returns:
  a title from the values in this builder
Throws:
  `IllegalStateException` - if title isn't specified