Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Configurate
* Copyright (C) zml and Configurate contributors
*
* 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 ninja.leaping.configurate;
import com.google.common.base.Function;
import java.util.List;
import java.util.Map;
/**
* A node in the configuration tree. This is more or less the main class of configurate, providing the methods to
* navigate through the configuration tree and get values
*/
public interface ConfigurationNode {
/**
* The key for this node.
* If this node is currently virtual, this method's result may be inaccurate.
*
* @return The key for this node
*/
public Object getKey();
/**
* The full path from the root to this node.
*
* Node implementations may keep a full path for each node, so this method may involve some object churn.
*
* @return An array compiled from the keys for each node up the hierarchy
*/
public Object[] getPath();
/**
* Returns the current parent for this node.
* If this node is currently virtual, this method's result may be inaccurate.
* @return The appropriate parent
*/
public ConfigurationNode getParent();
/**
* Return the options that currently apply to this node
*
* @return The ConfigurationOptions instance that governs the functionality of this node
*/
public ConfigurationOptions getOptions();
/**
* Get the current value associated with this node.
* If this node has children, this method will recursively unwrap them to construct a List or a Map
*
* @see #getValue(Object)
* @return This configuration's current value, or null if there is none
*/
public Object getValue();
/**
* Get the current value associated with this node.
* If this node has children, this method will recursively unwrap them to construct a List or a Map
*
* @param def The default value to return if this node has no set value
* @return This configuration's current value, or {@code def} if there is none
*/
public Object getValue(Object def);
/**
* Gets the appropriately transformed typed version of this node's value from the provided transformation function
*
* @param transformer The transformation function
* @param The expected type
* @return A transformed value of the correct type, or null either if no value is present or the value could not
* be converted
*/
public T getValue(Function