001/*
002 * Configurate
003 * Copyright (C) zml and Configurate contributors
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package ninja.leaping.configurate;
018
019/**
020 * An enumeration of the types of value a {@link ConfigurationNode} can hold.
021 *
022 * @deprecated Use {@link ConfigurationNode#isList()} and {@link ConfigurationNode#isMap()} for the same information
023 */
024@Deprecated
025public enum ValueType {
026
027    /**
028     * Represents a node that consists of a "single" scalar value
029     */
030    SCALAR,
031
032    /**
033     * Represents a node that consists of a number of child values, each mapped
034     * by a unique key.
035     */
036    MAP,
037
038    /**
039     * Represents a node that consists of a number of child values, in a specific
040     * order, each mapped by an index value.
041     */
042    LIST,
043
044    /**
045     * Represents a node that has no defined value.
046     */
047    NULL;
048
049    /**
050     * Gets if the type can hold child values.
051     *
052     * @return If the type can have children
053     */
054    public boolean canHaveChildren() {
055        return this == MAP || this == LIST;
056    }
057
058}