package net.tridentsdk.command.constraint;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import net.tridentsdk.command.CommandSourceType;

/**
 * @author TridentSDK
 * @since 0.5-alpha
 */
public interface ConstraintsAnnotations {

    /**
     * Add to a method so the Constraints framework will register it.
     */
    @Target(ElementType.METHOD)
    @Retention(RetentionPolicy.RUNTIME)
    @interface Constraints {}

    /**
     * A constraint for the command handler.
     *
     * <p>A constraint is a property which filters out illegal
     * calls to a command, such as args too small or too large.
     * </p>
     *
     * @author TridentSDK
     * @since 0.5-alpha
     */
    @Documented
    @Repeatable(Constrains.class)
    @Target(ElementType.METHOD)
    @Retention(RetentionPolicy.RUNTIME)
    @interface Constrain {
        /**
         * The constraining handler.
         *
         * @return the handler
         */
        Class<? extends Constraint> value();

        /**
         * The constraint type, by default there is none.
         *
         * @return the type
         */
        ConstraintType type() default ConstraintType.NONE;

        /**
         * The type of command sources allowed to run the
         * command. Must set {@link #type()} to
         * {@link ConstraintType#SOURCE}.
         *
         * @return the sources
         */
        CommandSourceType[] src() default { CommandSourceType.ALL };

        /**
         * An integer constraint. Must set {@link #type()} to
         * {@link ConstraintType#INT}.
         *
         * @return an integer constraint
         */
        int integer() default 0;

        /**
         * A string constraint. Must set {@link #type()} to
         * {@link ConstraintType#STRING}.
         *
         * @return a string constraint
         */
        String str() default "";
    }

    /**
     * A repeater class used to repeat the {@link Constrain}
     * annotation.
     *
     * @author TridentSDK
     * @since 0.5-alpha
     */
    @Documented
    @Target(ElementType.METHOD)
    @Retention(RetentionPolicy.RUNTIME)
    @interface Constrains {
        Constrain[] value();
    }
}

@@ -425,197 +425,8 @@
  %7B%0A%0A
-    /**%0A     * Add to a method so the Constraints framework will register it.%0A     */%0A    @Target(ElementType.METHOD)%0A    @Retention(RetentionPolicy.RUNTIME)%0A    @interface Constraints %7B%7D%0A%0A
     

Remove unused annotation