com.regnosys.rosetta.translate.GenerationResult Maven / Gradle / Ivy
package com.regnosys.rosetta.translate;
import org.eclipse.xtend.lib.annotations.Data;
import org.eclipse.xtext.xbase.lib.Pure;
import org.eclipse.xtext.xbase.lib.util.ToStringBuilder;
@Data
@SuppressWarnings("all")
public class GenerationResult {
private final boolean unchanged;
private final CharSequence changedValue;
public GenerationResult(final boolean unchanged, final CharSequence changedValue) {
super();
this.unchanged = unchanged;
this.changedValue = changedValue;
}
@Override
@Pure
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (this.unchanged ? 1231 : 1237);
return prime * result + ((this.changedValue== null) ? 0 : this.changedValue.hashCode());
}
@Override
@Pure
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GenerationResult other = (GenerationResult) obj;
if (other.unchanged != this.unchanged)
return false;
if (this.changedValue == null) {
if (other.changedValue != null)
return false;
} else if (!this.changedValue.equals(other.changedValue))
return false;
return true;
}
@Override
@Pure
public String toString() {
ToStringBuilder b = new ToStringBuilder(this);
b.add("unchanged", this.unchanged);
b.add("changedValue", this.changedValue);
return b.toString();
}
@Pure
public boolean isUnchanged() {
return this.unchanged;
}
@Pure
public CharSequence getChangedValue() {
return this.changedValue;
}
}