// Path: src/main/java/com/redfin/validity/FailedValidationExecutor.java
// public interface FailedValidationExecutor<X extends Throwable> {
// 
//     /**
//      * Signals the {@link FailedValidationExecutor} that the validation of the subject
//      * failed.
//      *
//      * @param expected        the String representation of the expected condition.
//      *                        May not be null.
//      * @param subject         the test subject.
//      *                        May be null.
//      * @param messageSupplier the {@link Supplier} of the String custom message supplied by the validation user.
//      *                        May not be null.
//      * @param <T>             the type of subject.
//      *
//      * @throws NullPointerException if expected or messageSupplier are null.
//      * @throws X                    always, unless expected is null.
//      */
//     <T> void fail(String expected,
//                   T subject,
//                   Supplier<String> messageSupplier) throws X;
// }
// 
// Path: src/main/java/com/redfin/validity/verifiers/AbstractVerifiableComparableNumber.java
// public abstract class AbstractVerifiableComparableNumber<T extends Number & Comparable<T>, X extends Throwable>
//               extends AbstractVerifiableComparable<T, X> {
// 
//     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//     // Instance Methods
//     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 
//     /**
//      * Create a new {@link AbstractVerifiableComparableNumber} instance with the given values.
//      *
//      * @param failedValidationExecutor the {@link FailedValidationExecutor} to be called
//      *                                 on validation failure.
//      *                                 May not be null.
//      * @param subject                  the subject to be validated.
//      *                                 May be null.
//      * @param messageSupplier          the {@link Supplier} of the String custom message to pre-pend a failure with.
//      *                                 May not be null.
//      *
//      * @throws NullPointerException if failedValidationExecutor or messageSupplier are null.
//      */
//     public AbstractVerifiableComparableNumber(FailedValidationExecutor<X> failedValidationExecutor,
//                                               T subject,
//                                               Supplier<String> messageSupplier) {
//         super(failedValidationExecutor, subject, messageSupplier);
//     }
// 
//     /**
//      * @return the value of Zero for the implementing
//      * subtype of number.
//      */
//     protected abstract T getZero();
// 
//     /**
//      * @return the subject if it is comparable to zero.
//      *
//      * @throws X if the subject is not comparable to zero.
//      */
//     public T isZero() throws X {
//         return isComparableTo(getZero());
//     }
// 
//     /**
//      * @return the subject if it is not comparable to zero.
//      *
//      * @throws X if the subject is comparable to zero.
//      */
//     public T isNotZero() throws X {
//         return isNotComparableTo(getZero());
//     }
// 
//     /**
//      * @return the subject if it is greater than zero.
//      *
//      * @throws X if the subject is less than or equal to zero.
//      */
//     public T isStrictlyPositive() throws X {
//         return isGreaterThan(getZero());
//     }
// 
//     /**
//      * @return the subject if it is less than zero.
//      *
//      * @throws X if the subject is greater than or equal to zero.
//      */
//     public T isStrictlyNegative() throws X {
//         return isLessThan(getZero());
//     }
// }


import com.redfin.validity.FailedValidationExecutor;
import com.redfin.validity.verifiers.AbstractVerifiableComparableNumber;
import java.util.function.Supplier;
/*
 * Copyright: (c) 2016 Redfin
 *
 * 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 com.redfin.validity.verifiers.objects;



/**
 * Concrete class for verifying Integer subjects.
 *
 * @param <X> the type of {@link Throwable} to be thrown on validation failure.
 */
public final class VerifiableInteger<X extends Throwable>
           extends AbstractVerifiableComparableNumber<Integer, X> {

    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Constants
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    private static final Integer ZERO = 0;

    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Instance Methods
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    /**
     * Create a new {@link VerifiableInteger} instance with the given values.
     *
     * @param failedValidationExecutor the {@link FailedValidationExecutor} to be called
     *                                 on validation failure.
     *                                 May not be null.
     * @param subject                  the subject to be validated.
     *                                 May be null.
     * @param messageSupplier          the {@link Supplier} of the String custom message to pre-pend a failure with.
     *                                 May not be null.
     *
     * @throws NullPointerException if failedValidationExecutor or messageSupplier are null.
     */
    public VerifiableInteger(FailedValidationExecutor<X> failedValidationExecutor,
                             Integer subject,
                             Supplier<String> messageSupplier) {
        super(failedValidationExecutor, subject, messageSupplier);
    }

    @Override
// Path: src/main/java/com/redfin/validity/FailedValidationExecutor.java
// public interface FailedValidationExecutor<X extends Throwable> {
// 
//     /**
//      * Signals the {@link FailedValidationExecutor} that the validation of the subject
//      * failed.
//      *
//      * @param expected        the String representation of the expected condition.
//      *                        May not be null.
//      * @param subject         the test subject.
//      *                        May be null.
//      * @param messageSupplier the {@link Supplier} of the String custom message supplied by the validation user.
//      *                        May not be null.
//      * @param <T>             the type of subject.
//      *
//      * @throws NullPointerException if expected or messageSupplier are null.
//      * @throws X                    always, unless expected is null.
//      */
//     <T> void fail(String expected,
//                   T subject,
//                   Supplier<String> messageSupplier) throws X;
// }
// 
// Path: src/main/java/com/redfin/validity/verifiers/AbstractVerifiableComparableNumber.java
// public abstract class AbstractVerifiableComparableNumber<T extends Number & Comparable<T>, X extends Throwable>
//               extends AbstractVerifiableComparable<T, X> {
// 
//     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//     // Instance Methods
//     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 
//     /**
//      * Create a new {@link AbstractVerifiableComparableNumber} instance with the given values.
//      *
//      * @param failedValidationExecutor the {@link FailedValidationExecutor} to be called
//      *                                 on validation failure.
//      *                                 May not be null.
//      * @param subject                  the subject to be validated.
//      *                                 May be null.
//      * @param messageSupplier          the {@link Supplier} of the String custom message to pre-pend a failure with.
//      *                                 May not be null.
//      *
//      * @throws NullPointerException if failedValidationExecutor or messageSupplier are null.
//      */
//     public AbstractVerifiableComparableNumber(FailedValidationExecutor<X> failedValidationExecutor,
//                                               T subject,
//                                               Supplier<String> messageSupplier) {
//         super(failedValidationExecutor, subject, messageSupplier);
//     }
// 
//     /**
//      * @return the value of Zero for the implementing
//      * subtype of number.
//      */
//     protected abstract T getZero();
// 
//     /**
//      * @return the subject if it is comparable to zero.
//      *
//      * @throws X if the subject is not comparable to zero.
//      */
//     public T isZero() throws X {
//         return isComparableTo(getZero());
//     }
// 
//     /**
//      * @return the subject if it is not comparable to zero.
//      *
//      * @throws X if the subject is comparable to zero.
//      */
//     public T isNotZero() throws X {
//         return isNotComparableTo(getZero());
//     }
// 
//     /**
//      * @return the subject if it is greater than zero.
//      *
//      * @throws X if the subject is less than or equal to zero.
//      */
//     public T isStrictlyPositive() throws X {
//         return isGreaterThan(getZero());
//     }
// 
//     /**
//      * @return the subject if it is less than zero.
//      *
//      * @throws X if the subject is greater than or equal to zero.
//      */
//     public T isStrictlyNegative() throws X {
//         return isLessThan(getZero());
//     }
// }


// Path: src/main/java/com/redfin/validity/verifiers/objects/VerifiableInteger.java
import com.redfin.validity.FailedValidationExecutor;
import com.redfin.validity.verifiers.AbstractVerifiableComparableNumber;
import java.util.function.Supplier;

/*
 * Copyright: (c) 2016 Redfin
 *
 * 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 com.redfin.validity.verifiers.objects;



/**
 * Concrete class for verifying Integer subjects.
 *
 * @param <X> the type of {@link Throwable} to be thrown on validation failure.
 */
public final class VerifiableInteger<X extends Throwable>
           extends AbstractVerifiableComparableNumber<Integer, X> {

    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Constants
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    private static final Integer ZERO = 0;

    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Instance Methods
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    /**
     * Create a new {@link VerifiableInteger} instance with the given values.
     *
     * @param failedValidationExecutor the {@link FailedValidationExecutor} to be called
     *                                 on validation failure.
     *                                 May not be null.
     * @param subject                  the subject to be validated.
     *                                 May be null.
     * @param messageSupplier          the {@link Supplier} of the String custom message to pre-pend a failure with.
     *                                 May not be null.
     *
     * @throws NullPointerException if failedValidationExecutor or messageSupplier are null.
     */
    public VerifiableInteger(FailedValidationExecutor<X> failedValidationExecutor,
                             Integer subject,
                             Supplier<String> messageSupplier) {
        super(failedValidationExecutor, subject, messageSupplier);
    }

    @Override
    protected Integer getZero() {