Commit 5da37648 by nikhilbonte Committed by Madhan Neethiraj

ATLAS-2979: added serviceType field to AtlasTypeDefHeader

parent 618cf361
...@@ -43,6 +43,7 @@ public class AtlasTypeDefHeader implements java.io.Serializable { ...@@ -43,6 +43,7 @@ public class AtlasTypeDefHeader implements java.io.Serializable {
private String guid; private String guid;
private String name; private String name;
private String serviceType = null;
private TypeCategory category; private TypeCategory category;
public AtlasTypeDefHeader() { public AtlasTypeDefHeader() {
...@@ -55,8 +56,13 @@ public class AtlasTypeDefHeader implements java.io.Serializable { ...@@ -55,8 +56,13 @@ public class AtlasTypeDefHeader implements java.io.Serializable {
this.category = category; this.category = category;
} }
public AtlasTypeDefHeader(String guid, String name, TypeCategory category, String serviceType) {
this(guid, name, category);
this.serviceType = serviceType;
}
public AtlasTypeDefHeader(AtlasBaseTypeDef typeDef) { public AtlasTypeDefHeader(AtlasBaseTypeDef typeDef) {
this(typeDef.getGuid(), typeDef.getName(), typeDef.getCategory()); this(typeDef.getGuid(), typeDef.getName(), typeDef.getCategory(), typeDef.getServiceType());
} }
public AtlasTypeDefHeader(AtlasTypeDefHeader other) { public AtlasTypeDefHeader(AtlasTypeDefHeader other) {
...@@ -65,10 +71,12 @@ public class AtlasTypeDefHeader implements java.io.Serializable { ...@@ -65,10 +71,12 @@ public class AtlasTypeDefHeader implements java.io.Serializable {
setGuid(null); setGuid(null);
setName(null); setName(null);
setCategory(null); setCategory(null);
setServiceType(null);
} else { } else {
setGuid(other.getGuid()); setGuid(other.getGuid());
setName(other.getName()); setName(other.getName());
setCategory(other.getCategory()); setCategory(other.getCategory());
setServiceType(other.getServiceType());
} }
} }
...@@ -96,6 +104,13 @@ public class AtlasTypeDefHeader implements java.io.Serializable { ...@@ -96,6 +104,13 @@ public class AtlasTypeDefHeader implements java.io.Serializable {
this.category = category; this.category = category;
} }
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
@Override @Override
public String toString() { public String toString() {
...@@ -110,12 +125,13 @@ public class AtlasTypeDefHeader implements java.io.Serializable { ...@@ -110,12 +125,13 @@ public class AtlasTypeDefHeader implements java.io.Serializable {
AtlasTypeDefHeader that = (AtlasTypeDefHeader) o; AtlasTypeDefHeader that = (AtlasTypeDefHeader) o;
return Objects.equals(guid, that.guid) && return Objects.equals(guid, that.guid) &&
Objects.equals(name, that.name) && Objects.equals(name, that.name) &&
Objects.equals(serviceType, that.serviceType) &&
category == that.category; category == that.category;
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(guid, name, category); return Objects.hash(guid, name, category, serviceType);
} }
public StringBuilder toString(StringBuilder sb) { public StringBuilder toString(StringBuilder sb) {
...@@ -127,6 +143,7 @@ public class AtlasTypeDefHeader implements java.io.Serializable { ...@@ -127,6 +143,7 @@ public class AtlasTypeDefHeader implements java.io.Serializable {
sb.append("guid='").append(guid).append('\''); sb.append("guid='").append(guid).append('\'');
sb.append(", name='").append(name).append('\''); sb.append(", name='").append(name).append('\'');
sb.append(", typeCategory='").append(category).append('\''); sb.append(", typeCategory='").append(category).append('\'');
sb.append(", serviceType='").append(serviceType).append('\'');
sb.append('}'); sb.append('}');
return sb; return sb;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment