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 org.spongepowered.configurate.interfaces.meta.range;
018
019import java.lang.annotation.ElementType;
020import java.lang.annotation.Retention;
021import java.lang.annotation.RetentionPolicy;
022import java.lang.annotation.Target;
023
024/**
025 * This annotation limits the values that a config node can have.
026 * Because of annotation limits, there is an annotation for:
027 * {@link DecimalRange decimals}, {@link NumericRange numerics} and
028 * {@link StringRange String length}.
029 *
030 * @since 4.2.0
031 */
032@Retention(RetentionPolicy.RUNTIME)
033@Target(ElementType.METHOD)
034public @interface NumericRange {
035    /**
036     * The minimal value allowed (inclusive.)
037     *
038     * @return the minimal value allowed (inclusive.)
039     * @since 4.2.0
040     */
041    long from();
042
043    /**
044     * The maximal value allowed (inclusive.)
045     *
046     * @return the maximal value allowed (inclusive.)
047     * @since 4.2.0
048     */
049    long to();
050
051}