Package ch.njol.skript.lang
Class SyntaxStringBuilder
java.lang.Object
ch.njol.skript.lang.SyntaxStringBuilder
Utility class to build syntax strings, primarily intended for use
in
Debuggable.toString(Event, boolean) implementations.
Spaces are automatically added between the provided objects.-
Constructor Summary
ConstructorsConstructorDescriptionSyntaxStringBuilder(@Nullable org.bukkit.event.Event event, boolean debug) Creates a new SyntaxStringBuilder. -
Method Summary
Modifier and TypeMethodDescriptionAdds an object to the string and returns the builder.Adds multiple objects to the string and returns the builder.Adds an object to the string and returns the builder, if the given condition is true.Adds multiple objects to the string and returns the builder, if the given condition is true.toString()
-
Constructor Details
-
SyntaxStringBuilder
public SyntaxStringBuilder(@Nullable @Nullable org.bukkit.event.Event event, boolean debug) Creates a new SyntaxStringBuilder.- Parameters:
event- The event to get information from. This is always null if debug == false.debug- If true this should print more information, if false this should print what is shown to the end user
-
-
Method Details
-
append
Adds an object to the string and returns the builder. Spaces are automatically added between the provided objects. If the object is aDebuggableit will be formatted usingDebuggable.toString(Event, boolean).- Parameters:
object- The object to add.- Returns:
- The builder.
- See Also:
-
append
Adds multiple objects to the string and returns the builder. Spaces are automatically added between the provided objects.- Parameters:
objects- The objects to add.- Returns:
- The builder.
- See Also:
-
appendIf
Adds an object to the string and returns the builder, if the given condition is true. Spaces are automatically added between the provided objects. If the object is aDebuggableit will be formatted usingDebuggable.toString(Event, boolean).- Parameters:
condition- The condition.object- The object to add. Ensure this is not null.- Returns:
- The builder.
- See Also:
-
appendIf
Adds multiple objects to the string and returns the builder, if the given condition is true. Spaces are automatically added between the provided objects.- Parameters:
condition- The condition.objects- The objects to add. Ensure this is not null.- Returns:
- The builder.
- See Also:
-
toString
-