net.sf.brunneng.jom.diff.creation.NullObject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-object-merger Show documentation
Show all versions of java-object-merger Show documentation
Tool for merging objects of possible different type but similar structure
package net.sf.brunneng.jom.diff.creation;
import java.lang.reflect.Type;
/**
* Represent null object of specified class.
*
This is internal class and should not be used by clients of library.
*/
public class NullObject {
private final Type objectType;
public NullObject(Type objectType) {
this.objectType = objectType;
}
public Type getObjectType() {
return objectType;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NullObject that = (NullObject) o;
if (objectType != null ? !objectType.equals(that.objectType) : that.objectType != null) return false;
return true;
}
@Override
public int hashCode() {
return objectType != null ? objectType.hashCode() : 0;
}
}