Class MinecraftSerializerOptions<O>
- java.lang.Object
-
- dev.vankka.mcdiscordreserializer.minecraft.MinecraftSerializerOptions<O>
-
- Type Parameters:
O- the type of the result produced with the renderers
public class MinecraftSerializerOptions<O> extends java.lang.ObjectOptions forMinecraftSerializers.
-
-
Constructor Summary
Constructors Constructor Description MinecraftSerializerOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MinecraftSerializerOptions<O>addRenderer(int index, NodeRenderer<O> renderer)Creates a instance ofMinecraftSerializerOptionswith the given renderer added at the given index, keep in mind a default renderer is always present.MinecraftSerializerOptions<O>addRenderer(NodeRenderer<O> renderer)Creates a instance ofMinecraftSerializerOptionswith the given renderer added.static MinecraftSerializerOptions<net.kyori.adventure.text.Component>defaults()Creates the defaultMinecraftSerializerOptionsfor serialization.static MinecraftSerializerOptions<java.lang.String>escapeDefaults()Creates the defaultMinecraftSerializerOptionsfor escaping markdown.java.util.List<NodeRenderer<O>>getRenderers()Returns the renderers for this options instance.MinecraftSerializerOptions<O>removeRenderer(NodeRenderer<O> renderer)Creates a instance ofMinecraftSerializerOptionswithout the given renderer.
-
-
-
Method Detail
-
defaults
public static MinecraftSerializerOptions<net.kyori.adventure.text.Component> defaults()
Creates the defaultMinecraftSerializerOptionsfor serialization.- Returns:
- the default
MinecraftSerializerOptions.
-
escapeDefaults
public static MinecraftSerializerOptions<java.lang.String> escapeDefaults()
Creates the defaultMinecraftSerializerOptionsfor escaping markdown.- Returns:
- the default
MinecraftSerializerOptions.
-
addRenderer
public MinecraftSerializerOptions<O> addRenderer(NodeRenderer<O> renderer)
Creates a instance ofMinecraftSerializerOptionswith the given renderer added.- Parameters:
renderer- the renderer to add- Returns:
- the new instance of options
- Throws:
java.lang.IllegalArgumentException- if the renderer is already included in this options instance or is of typeDefaultMinecraftRenderer- See Also:
List.add(Object)
-
addRenderer
public MinecraftSerializerOptions<O> addRenderer(int index, NodeRenderer<O> renderer)
Creates a instance ofMinecraftSerializerOptionswith the given renderer added at the given index, keep in mind a default renderer is always present.- Parameters:
renderer- the renderer to addindex- the index to add the renderer at- Returns:
- the new instance of options
- Throws:
java.lang.IllegalArgumentException- if the renderer is already included in this options instance or is of typeDefaultMinecraftRenderer- See Also:
List.add(int, Object)
-
removeRenderer
public MinecraftSerializerOptions<O> removeRenderer(NodeRenderer<O> renderer)
Creates a instance ofMinecraftSerializerOptionswithout the given renderer.- Parameters:
renderer- the renderer to remove- Returns:
- the new instance of options
- Throws:
java.lang.IllegalArgumentException- if the renderer is not included in this options instance
-
getRenderers
public java.util.List<NodeRenderer<O>> getRenderers()
Returns the renderers for this options instance.- Returns:
- the ordered unmodifiable list of
-
-