@@ -0,0 +1,2912 @@
+/*%0A * Copyright (C) 2008 The Guava Authors%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you may not use this file except%0A * in compliance with the License. You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software distributed under the License%0A * is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express%0A * or implied. See the License for the specific language governing permissions and limitations under%0A * the License.%0A */%0A%0Apackage io.dmitryivanov.crdt.helpers;%0A%0Apublic final class Primitives %7B%0A    private Primitives() %7B%0A        // No instances%0A    %7D%0A%0A    /**%0A     * Compares the two specified %7B@code boolean%7D values in the standard way (%7B@code false%7D is%0A     * considered less than %7B@code true%7D). The sign of the value returned is the same as that of%0A     * %7B@code ((Boolean) a).compareTo(b)%7D.%0A     * %3Cp%3E%0A     * %3Cb%3ENote for Java 7 and later:%3C/b%3E this method should be treated as deprecated; use the%0A     * equivalent %7B@link Boolean#compare%7D method instead.%0A     *%0A     * @param a the first %7B@code boolean%7D to compare%0A     * @param b the second %7B@code boolean%7D to compare%0A     * @return a positive number if only %7B@code a%7D is %7B@code true%7D, a negative number if only%0A     *         %7B@code b%7D is true, or zero if %7B@code a == b%7D%0A     */%0A    public static int compare(boolean a, boolean b) %7B%0A        return (a == b) ? 0 : (a ? 1 : -1);%0A    %7D%0A%0A    /**%0A     * Compares the two specified %7B@code int%7D values. The sign of the value returned is the same as%0A     * that of %7B@code ((Integer) a).compareTo(b)%7D.%0A     *%0A     * %3Cp%3E%3Cb%3ENote for Java 7 and later:%3C/b%3E this method should be treated as deprecated; use the%0A     * equivalent %7B@link Integer#compare%7D method instead.%0A     *%0A     * @param a the first %7B@code int%7D to compare%0A     * @param b the second %7B@code int%7D to compare%0A     * @return a negative value if %7B@code a%7D is less than %7B@code b%7D; a positive value if %7B@code a%7D is%0A     *     greater than %7B@code b%7D; or zero if they are equal%0A     */%0A    public static int compare(int a, int b) %7B%0A        return (a %3C b) ? -1 : ((a %3E b) ? 1 : 0);%0A    %7D%0A%0A    /**%0A     * Compares the two specified %7B@code long%7D values. The sign of the value returned is the same as%0A     * that of %7B@code ((Long) a).compareTo(b)%7D.%0A     *%0A     * %3Cp%3E%3Cb%3ENote for Java 7 and later:%3C/b%3E this method should be treated as deprecated; use the%0A     * equivalent %7B@link Long#compare%7D method instead.%0A     *%0A     * @param a the first %7B@code long%7D to compare%0A     * @param b the second %7B@code long%7D to compare%0A     * @return a negative value if %7B@code a%7D is less than %7B@code b%7D; a positive value if %7B@code a%7D is%0A     *     greater than %7B@code b%7D; or zero if they are equal%0A     */%0A    public static int compare(long a, long b) %7B%0A        return (a %3C b) ? -1 : ((a %3E b) ? 1 : 0);%0A    %7D%0A%7D%0A

Add Primitive compare operations