com.enterprisemath.dao.big.UpdateOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of em-dao Show documentation
Show all versions of em-dao Show documentation
Simple and powerful data access layer.
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