All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.aurelium.auraskills.api.config.ConfigNode Maven / Gradle / Ivy

There is a newer version: 2.2.3
Show newest version
package dev.aurelium.auraskills.api.config;

import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

/**
 * An interface that copies the Configurate ConfigurationNode and is
 * implemented by it under the hood. This is used in the API to allow
 * AuraSkills to relocate Configurate packages while keeping API configuration
 * functionality. All methods work exactly like ConfigurationNode from Configurate,
 * though not all methods are available.
 */
public interface ConfigNode {

    @Nullable Object key();

    @Nullable ConfigNode parent();

    ConfigNode node(Object... path);

    ConfigNode node(Iterable path);

    boolean hasChild(Object... path);

    boolean hasChild(Iterable path);

    boolean virtual();

    boolean isNull();

    boolean isList();

    boolean isMap();

    boolean empty();

    List childrenList();

    Map childrenMap();

     @Nullable V get(Class type);

     V get(Class type, V def);

     V get(Class type, Supplier defSupplier);

    @Nullable Object get(Type type);

    Object get(Type type, Object def);

    Object get(Type type, Supplier defSupplier);

     @Nullable List getList(Class type);

     List getList(Class elementType, List def);

     List getList(Class elementType, Supplier> defSupplier);

    @Nullable String getString();

    String getString(String def);

    float getFloat();

    float getFloat(float def);

    double getDouble();

    double getDouble(double def);

    int getInt();

    int getInt(int def);

    long getLong();

    long getLong(long def);

    boolean getBoolean();

    boolean getBoolean(boolean def);

    ConfigNode set(@Nullable Object value);

     ConfigNode set(Class type, @Nullable V value);

    ConfigNode set(Type type, @Nullable Object value);

     ConfigNode setList(final Class elementType, final @Nullable List items);

    @Nullable Object raw();

    ConfigNode raw(Object value);

    @Nullable Object rawScalar();

    ConfigNode from(ConfigNode other);

    ConfigNode mergeFrom(ConfigNode other);

    boolean removeChild(Object key);

    ConfigNode appendListNode();

    ConfigNode copy();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy