com.flyfish.oauth.domain.raw.Domain Maven / Gradle / Ivy
package com.flyfish.oauth.domain.raw;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public abstract class Domain {
/**
* 主键
*/
protected String id;
/**
* 编号
*/
protected String code;
/**
* 名称
*/
protected String name;
@Override
public int hashCode() {
if (id != null) {
return id.hashCode();
}
return super.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj instanceof Domain) {
Domain comparing = (Domain) obj;
if (this.getId() == null || comparing.getId() == null) {
return false;
}
return this.getId().equals(comparing.getId());
}
return false;
}
}