package org.hibernate.boot.jaxb;
import java.io.Serializable;
import java.util.Locale;
import org.hibernate.internal.util.compare.EqualsHelper;
public class Origin implements Serializable {
public static final String UNKNOWN_FILE_PATH = "<unknown>";
private final SourceType type;
private final String name;
public Origin(SourceType type, String name) {
this.type = type;
this.name = name;
}
public SourceType getType() {
return type;
}
public String getName() {
return name;
}
@Override
public boolean equals(Object o) {
if ( this == o ) {
return true;
}
if ( !( o instanceof Origin ) ) {
return false;
}
final Origin other = (Origin) o;
return type == other.type
&& EqualsHelper.equals( name, other.name );
}
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + ( name != null ? name.hashCode() : 0 );
return result;
}
@Override
public String toString() {
return String.format( Locale.ENGLISH, "Origin(name=%s,type=%s)", name, type );
}
}