Class TypeSerializerCollection
- java.lang.Object
-
- org.spongepowered.configurate.serialize.TypeSerializerCollection
-
public final class TypeSerializerCollection extends Object
A calculated collection ofTypeSerializer
s.- Since:
- 4.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypeSerializerCollection.Builder
A builder to construct new serializer collections.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TypeSerializerCollection.Builder
builder()
Create a builder for a new type serializer collection without a parent set.TypeSerializerCollection.Builder
childBuilder()
Create a new builder to begin building a collection of type serializers that inherits from this collection.static TypeSerializerCollection
defaults()
Get a collection containing all of Configurate's built-in type serializers.boolean
equals(Object other)
<T> @Nullable TypeSerializer<T>
get(TypeToken<T> token)
Resolve a type serializer.<T> @Nullable TypeSerializer<T>
get(Class<T> token)
Resolve a type serializer.@Nullable TypeSerializer<?>
get(Type type)
Resolve a type serializer.int
hashCode()
String
toString()
-
-
-
Method Detail
-
get
public <T> @Nullable TypeSerializer<T> get(TypeToken<T> token)
Resolve a type serializer.First, all registered serializers from this collection are queried in registration order, then if a parent collection is set, that collection is queried.
- Type Parameters:
T
- the type to serialize- Parameters:
token
- the type a serializer is required for- Returns:
- a serializer if any is present, or null if no applicable serializer is found
- Since:
- 4.0.0
-
get
public <T> @Nullable TypeSerializer<T> get(Class<T> token)
Resolve a type serializer.First, all registered serializers from this collection are queried in registration order, then if a parent collection is set, that collection is queried.
This method will fail when provided a raw parameterized type
- Type Parameters:
T
- the type to serialize- Parameters:
token
- the type a serializer is required for- Returns:
- a serializer if any is present, or null if no applicable serializer is found
- Since:
- 4.0.0
-
get
public @Nullable TypeSerializer<?> get(Type type)
Resolve a type serializer.First, all registered serializers from this collection are queried then if a parent collection is set, that collection is queried.
- Parameters:
type
- the type a serializer is required for- Returns:
- a serializer if any is present, or null if no applicable serializer is found
- Since:
- 4.0.0
-
childBuilder
public TypeSerializerCollection.Builder childBuilder()
Create a new builder to begin building a collection of type serializers that inherits from this collection.- Returns:
- the new builder
- Since:
- 4.0.0
-
builder
public static TypeSerializerCollection.Builder builder()
Create a builder for a new type serializer collection without a parent set.If any of the standard serializers provided by Configurate are desired, either the default collection or a collection inheriting from the default collection should be applied.
- Returns:
- the builder
- Since:
- 4.0.0
-
defaults
public static TypeSerializerCollection defaults()
Get a collection containing all of Configurate's built-in type serializers.- Returns:
- the collection
- Since:
- 4.0.0
-
-