<commit_before>//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011-2012, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.syncdb;

/**
 * Provides a mechanism for resolving conflict between two conflicting values in a sync db.
 */
public interface Resolver<T>
{
    /** Uses the server value, ignoring the client value. */
    Resolver<Object> SERVER = new Resolver<Object>() {
        public <V> V resolve (V client, V server) {
            return server;
        }
    };

    /** Uses the smallest of the client and server integers. */
    Resolver<Integer> INTMIN = new Resolver<Integer>() {
        public Integer resolve (Integer client, Integer server) {
            return (client > server) ? server : client;
        }
    };

    /** Uses the largest of the client and server integers. */
    Resolver<Integer> INTMAX = new Resolver<Integer>() {
        public Integer resolve (Integer client, Integer server) {
            return (client > server) ? client : server;
        }
    };

    /** Uses the largest of the client and server longs. */
    Resolver<Long> LONGMAX = new Resolver<Long>() {
        public Long resolve (Long client, Long server) {
            return (client > server) ? client : server;
        }
    };

    /** Uses the largest of the client and server floats. */
    Resolver<Float> FLOATMAX = new Resolver<Float>() {
        public Float resolve (Float client, Float server) {
            return (client > server) ? client : server;
        }
    };

    /** Uses whichever of the client or server is true. */
    Resolver<Boolean> TRUE = new Resolver<Boolean>() {
        public Boolean resolve (Boolean client, Boolean server) {
            return client ? client : server;
        }
    };

    /** Uses whichever of the client or server is false. */
    Resolver<Boolean> FALSE = new Resolver<Boolean>() {
        public Boolean resolve (Boolean client, Boolean server) {
            return client ? server : client;
        }
    };

    /** Resolves a conflict between a client and server value.
     * @return the value to be used on the client. */<commit_msg>Eclipse was wrong about these type shenanigans.<commit_after>//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011-2012, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.syncdb;

/**
 * Provides a mechanism for resolving conflict between two conflicting values in a sync db.
 */
public interface Resolver<T>
{
    /** Uses the server value, ignoring the client value. */
    Resolver<Object> SERVER = new Resolver<Object>() {
        public <V> V resolve (V client, V server) {
            return server;
        }
    };

    /** Uses the smallest of the client and server integers. */
    Resolver<Integer> INTMIN = new Resolver<Integer>() {
        public <V extends Integer> V resolve (V client, V server) {
            return (client > server) ? server : client;
        }
    };

    /** Uses the largest of the client and server integers. */
    Resolver<Integer> INTMAX = new Resolver<Integer>() {
        public <V extends Integer> V resolve (V client, V server) {
            return (client > server) ? client : server;
        }
    };

    /** Uses the largest of the client and server longs. */
    Resolver<Long> LONGMAX = new Resolver<Long>() {
        public <V extends Long> V resolve (V client, V server) {
            return (client > server) ? client : server;
        }
    };

    /** Uses the largest of the client and server floats. */
    Resolver<Float> FLOATMAX = new Resolver<Float>() {
        public <V extends Float> V resolve (V client, V server) {
            return (client > server) ? client : server;
        }
    };

    /** Uses whichever of the client or server is true. */
    Resolver<Boolean> TRUE = new Resolver<Boolean>() {
        public <V extends Boolean> V resolve (V client, V server) {
            return client ? client : server;
        }
    };

    /** Uses whichever of the client or server is false. */
    Resolver<Boolean> FALSE = new Resolver<Boolean>() {
        public <V extends Boolean> V resolve (V client, V server) {
            return client ? server : client;
        }
    };

    /** Resolves a conflict between a client and server value.
     * @return the value to be used on the client. */
{'fraction_non_alphanumeric': 0.10628342245989304, 'fraction_numerical': 0.0035650623885918, 'mean_word_length': 2.3650674662668667, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4257911', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1176, 'n_words': 478}