Commit c5ea4f0e by Madhan Neethiraj

ATLAS-1547: update setter name for rename of EntityMutationResponse.mutatedEntities

parent 9b8a5ddc
...@@ -44,48 +44,61 @@ import org.codehaus.jackson.map.annotate.JsonSerialize; ...@@ -44,48 +44,61 @@ import org.codehaus.jackson.map.annotate.JsonSerialize;
@XmlAccessorType(XmlAccessType.PROPERTY) @XmlAccessorType(XmlAccessType.PROPERTY)
public class EntityMutationResponse { public class EntityMutationResponse {
Map<EntityMutations.EntityOperation, List<AtlasEntityHeader>> entitiesMutated; Map<EntityMutations.EntityOperation, List<AtlasEntityHeader>> mutatedEntities;
Map<String,String> guidAssignments; Map<String,String> guidAssignments;
public EntityMutationResponse() { public EntityMutationResponse() {
} }
public EntityMutationResponse(final Map<EntityMutations.EntityOperation, List<AtlasEntityHeader>> opVsEntityMap) { public EntityMutationResponse(final Map<EntityMutations.EntityOperation, List<AtlasEntityHeader>> mutatedEntities) {
this.entitiesMutated = opVsEntityMap; this.mutatedEntities = mutatedEntities;
} }
public Map<EntityMutations.EntityOperation, List<AtlasEntityHeader>> getMutatedEntities() { public Map<EntityMutations.EntityOperation, List<AtlasEntityHeader>> getMutatedEntities() {
return entitiesMutated; return mutatedEntities;
} }
public void setEntitiesMutated(final Map<EntityMutations.EntityOperation, List<AtlasEntityHeader>> opVsEntityMap) { public void setMutatedEntities(final Map<EntityMutations.EntityOperation, List<AtlasEntityHeader>> mutatedEntities) {
this.entitiesMutated = opVsEntityMap; this.mutatedEntities = mutatedEntities;
} }
public void setGuidAssignments(Map<String,String> guidAssignments) {
this.guidAssignments = guidAssignments;
}
public Map<String,String> getGuidAssignments() {
return guidAssignments;
}
@JsonIgnore
public List<AtlasEntityHeader> getEntitiesByOperation(EntityMutations.EntityOperation op) { public List<AtlasEntityHeader> getEntitiesByOperation(EntityMutations.EntityOperation op) {
if ( entitiesMutated != null) { if ( mutatedEntities != null) {
return entitiesMutated.get(op); return mutatedEntities.get(op);
} }
return null; return null;
} }
@JsonIgnore
public List<AtlasEntityHeader> getCreatedEntities() { public List<AtlasEntityHeader> getCreatedEntities() {
if ( entitiesMutated != null) { if ( mutatedEntities != null) {
return entitiesMutated.get(EntityMutations.EntityOperation.CREATE); return mutatedEntities.get(EntityMutations.EntityOperation.CREATE);
} }
return null; return null;
} }
@JsonIgnore
public List<AtlasEntityHeader> getUpdatedEntities() { public List<AtlasEntityHeader> getUpdatedEntities() {
if ( entitiesMutated != null) { if ( mutatedEntities != null) {
return entitiesMutated.get(EntityMutations.EntityOperation.UPDATE); return mutatedEntities.get(EntityMutations.EntityOperation.UPDATE);
} }
return null; return null;
} }
@JsonIgnore
public List<AtlasEntityHeader> getDeletedEntities() { public List<AtlasEntityHeader> getDeletedEntities() {
if ( entitiesMutated != null) { if ( mutatedEntities != null) {
return entitiesMutated.get(EntityMutations.EntityOperation.DELETE); return mutatedEntities.get(EntityMutations.EntityOperation.DELETE);
} }
return null; return null;
} }
...@@ -151,15 +164,15 @@ public class EntityMutationResponse { ...@@ -151,15 +164,15 @@ public class EntityMutationResponse {
} }
public void addEntity(EntityMutations.EntityOperation op, AtlasEntityHeader header) { public void addEntity(EntityMutations.EntityOperation op, AtlasEntityHeader header) {
if (entitiesMutated == null) { if (mutatedEntities == null) {
entitiesMutated = new HashMap<>(); mutatedEntities = new HashMap<>();
} }
List<AtlasEntityHeader> opEntities = entitiesMutated.get(op); List<AtlasEntityHeader> opEntities = mutatedEntities.get(op);
if (opEntities == null) { if (opEntities == null) {
opEntities = new ArrayList<>(); opEntities = new ArrayList<>();
entitiesMutated.put(op, opEntities); mutatedEntities.put(op, opEntities);
} }
opEntities.add(header); opEntities.add(header);
...@@ -171,7 +184,7 @@ public class EntityMutationResponse { ...@@ -171,7 +184,7 @@ public class EntityMutationResponse {
sb = new StringBuilder(); sb = new StringBuilder();
} }
AtlasBaseTypeDef.dumpObjects(entitiesMutated, sb); AtlasBaseTypeDef.dumpObjects(mutatedEntities, sb);
return sb; return sb;
} }
...@@ -181,13 +194,13 @@ public class EntityMutationResponse { ...@@ -181,13 +194,13 @@ public class EntityMutationResponse {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
EntityMutationResponse that = (EntityMutationResponse) o; EntityMutationResponse that = (EntityMutationResponse) o;
return Objects.equals(entitiesMutated, that.entitiesMutated) && return Objects.equals(mutatedEntities, that.mutatedEntities) &&
Objects.equals(guidAssignments, that.guidAssignments); Objects.equals(guidAssignments, that.guidAssignments);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(entitiesMutated, guidAssignments); return Objects.hash(mutatedEntities, guidAssignments);
} }
@Override @Override
...@@ -231,11 +244,4 @@ public class EntityMutationResponse { ...@@ -231,11 +244,4 @@ public class EntityMutationResponse {
} }
return null; return null;
} }
public void setGuidAssignments(Map<String,String> guidAssignments) {
this.guidAssignments = guidAssignments;
}
public Map<String,String> getGuidAssignments() {
return guidAssignments;
}
} }
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