com.enterprisemath.dao.big.InsertOptions 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 insertion.
* Default options are set up in the way that consistency is preferred over performance.
*
* @author radek.hecl
*/
public class InsertOptions {
/**
* Builder object.
*/
public static class Builder {
/**
* Builds the result object.
*
* @return created object
*/
public InsertOptions build() {
return new InsertOptions(this);
}
}
/**
* Creates new instance.
*
* @param builder builder object
*/
public InsertOptions(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 InsertOptions createDefault() {
return new InsertOptions.Builder().
build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy