
dev.dejvokep.boostedyaml.spigot.SpigotSerializer Maven / Gradle / Ivy
/*
* Copyright 2022 https://dejvokep.dev/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.dejvokep.boostedyaml.spigot;
import dev.dejvokep.boostedyaml.serialization.YamlSerializer;
import dev.dejvokep.boostedyaml.utils.supplier.MapSupplier;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
/**
* Custom serializer singleton which supports {@link ConfigurationSerialization}.
*/
public class SpigotSerializer implements YamlSerializer {
/**
* Serializer instance.
*/
private static final SpigotSerializer instance = new SpigotSerializer();
/**
* All supported abstract classes.
*/
private static final Set> SUPPORTED_ABSTRACT_CLASSES = new HashSet>() {{
add(ConfigurationSerializable.class);
}};
@Override
@Nullable
public Object deserialize(@NotNull Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy