com.imsweb.staging.entities.StagingMapping Maven / Gradle / Ivy
/*
* Copyright (C) 2014 Information Management Services, Inc.
*/
package com.imsweb.staging.entities;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import org.mongodb.morphia.annotations.Embedded;
import org.mongodb.morphia.annotations.Property;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.imsweb.decisionengine.Mapping;
@JsonPropertyOrder({"id", "name", "inclusion_tables", "exclusion_tables", "initial_context", "tables"})
@Embedded
public class StagingMapping implements Mapping {
@Property("id")
private String _id;
@Property("name")
private String _name;
@Embedded("inclusion_tables")
private List _inclusionTables;
@Embedded("exclusion_tables")
private List _exclusionTables;
@Embedded("initial_context")
private Set _initialContext;
@Embedded("tables")
private List _tablePaths;
/**
* Default constructor
*/
public StagingMapping() {
}
/**
* Constructs with a name and title
* @param id identifier
* @param name name
*/
public StagingMapping(String id, String name) {
setId(id);
setName(name);
}
@Override
@JsonProperty("id")
public String getId() {
return _id;
}
public void setId(String id) {
_id = id;
}
@JsonProperty("name")
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
@Override
@JsonProperty("inclusion_tables")
public List getInclusionTables() {
return _inclusionTables;
}
public void setInclusionTables(List inclusionTables) {
_inclusionTables = inclusionTables;
}
@Override
@JsonProperty("exclusion_tables")
public List getExclusionTables() {
return _exclusionTables;
}
public void setExclusionTables(List exclusionTables) {
_exclusionTables = exclusionTables;
}
@Override
@JsonProperty("initial_context")
public Set getInitialContext() {
return _initialContext;
}
@JsonDeserialize(as = LinkedHashSet.class)
public void setInitialContext(Set initialContext) {
_initialContext = initialContext;
}
@Override
@JsonProperty("tables")
public List getTablePaths() {
return _tablePaths;
}
public void setTablePaths(List tablePaths) {
_tablePaths = tablePaths;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
StagingMapping mapping = (StagingMapping)o;
return Objects.equals(_id, mapping._id) &&
Objects.equals(_name, mapping._name) &&
Objects.equals(_inclusionTables, mapping._inclusionTables) &&
Objects.equals(_exclusionTables, mapping._exclusionTables) &&
Objects.equals(_initialContext, mapping._initialContext) &&
Objects.equals(_tablePaths, mapping._tablePaths);
}
@Override
public int hashCode() {
return Objects.hash(_id, _name, _inclusionTables, _exclusionTables, _initialContext, _tablePaths);
}
}