io.sphere.sdk.models.Base Maven / Gradle / Ivy
package io.sphere.sdk.models;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* A base class which implements {@link Object#toString()}, {@link Object#hashCode()} and {@link Object#equals(Object)} by reflection.
*/
public abstract class Base {
@Override
public boolean equals(Object o) {
return EqualsBuilder.reflectionEquals(this, o);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, SdkDefaults.TO_STRING_STYLE);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy