All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enterprisemath.dao.big.UpdateOptions Maven / Gradle / Ivy

There is a newer version: 4.3.2
Show newest version
package com.enterprisemath.dao.big;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * Options for updating.
 * Default options are set up in the way that consistency is preferred over performance.
 *
 * @author radek.hecl
 */
public class UpdateOptions {

    /**
     * Builder object.
     */
    public static class Builder {

        /**
         * Builds the result object.
         *
         * @return created object
         */
        public UpdateOptions build() {
            return new UpdateOptions(this);
        }
    }

    /**
     * Creates new instance.
     *
     * @param builder builder object
     */
    public UpdateOptions(Builder builder) {
        guardInvariants();
    }

    /**
     * Guards this object to be consistent. Throws exception if this is not the case.
     */
    private void guardInvariants() {
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

    @Override
    public boolean equals(Object obj) {
        return EqualsBuilder.reflectionEquals(this, obj);
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    /**
     * Creates default options.
     * Default options are set up in the way that consistency is preferred over performance.
     *
     * @return created options
     */
    public static UpdateOptions createDefault() {
        return new UpdateOptions.Builder().
                build();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy