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

io.nflow.engine.model.ModelObject Maven / Gradle / Ivy

There is a newer version: 10.0.0
Show newest version
package io.nflow.engine.model;

import static org.apache.commons.lang3.builder.EqualsBuilder.reflectionEquals;
import static org.apache.commons.lang3.builder.HashCodeBuilder.reflectionHashCode;
import static org.apache.commons.lang3.builder.ToStringBuilder.reflectionToString;
import static org.apache.commons.lang3.builder.ToStringStyle.SHORT_PREFIX_STYLE;

/**
 * Inheriting ModelObject is an implementation detail only to provide toString/equals/hashCode for subclasses. We would use
 * something more sensible method, but this is what Java allows. User code should never use ModelObject for anything.
 */
public abstract class ModelObject {

  @Override
  public String toString() {
    return reflectionToString(this, SHORT_PREFIX_STYLE);
  }

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

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy