Updated Rules
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@114300 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9256c69e17
commit
67c2fc42e0
|
@ -0,0 +1,55 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.shared.rule;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class AppliedRulesResponseData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8194665246008663941L;
|
||||
|
||||
private ArrayList<RuleDescriptionData> tableRules;
|
||||
//Map of <ColumnId, Rules>
|
||||
private HashMap<String, ArrayList<RuleDescriptionData>> columnRuleMapping;
|
||||
|
||||
public AppliedRulesResponseData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public AppliedRulesResponseData(ArrayList<RuleDescriptionData> tableRules,
|
||||
HashMap<String, ArrayList<RuleDescriptionData>> columnRuleMapping) {
|
||||
super();
|
||||
this.tableRules = tableRules;
|
||||
this.columnRuleMapping = columnRuleMapping;
|
||||
}
|
||||
|
||||
public ArrayList<RuleDescriptionData> getTableRules() {
|
||||
return tableRules;
|
||||
}
|
||||
|
||||
public void setTableRules(ArrayList<RuleDescriptionData> tableRules) {
|
||||
this.tableRules = tableRules;
|
||||
}
|
||||
|
||||
public HashMap<String, ArrayList<RuleDescriptionData>> getColumnRuleMapping() {
|
||||
return columnRuleMapping;
|
||||
}
|
||||
|
||||
public void setColumnRuleMapping(
|
||||
HashMap<String, ArrayList<RuleDescriptionData>> columnRuleMapping) {
|
||||
this.columnRuleMapping = columnRuleMapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AppliedRulesResponseData [tableRules=" + tableRules
|
||||
+ ", columnRuleMapping=" + columnRuleMapping + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -26,28 +26,26 @@ public class RuleDescriptionData implements Serializable {
|
|||
super();
|
||||
}
|
||||
|
||||
public RuleDescriptionData(long id, String name, String description, String owner,
|
||||
RuleScopeType scope,
|
||||
C_Expression expression) {
|
||||
public RuleDescriptionData(long id, String name, String description,
|
||||
String owner, RuleScopeType scope, C_Expression expression) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.owner=owner;
|
||||
this.owner = owner;
|
||||
this.scope = scope;
|
||||
this.tdRuleColumnType = null;
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
|
||||
public RuleDescriptionData(long id, String name, String description,String owner,
|
||||
RuleScopeType scope, TDRuleColumnType tdRuleColumnType,
|
||||
C_Expression expression) {
|
||||
|
||||
public RuleDescriptionData(long id, String name, String description,
|
||||
String owner, RuleScopeType scope,
|
||||
TDRuleColumnType tdRuleColumnType, C_Expression expression) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.owner=owner;
|
||||
this.owner = owner;
|
||||
this.scope = scope;
|
||||
this.tdRuleColumnType = tdRuleColumnType;
|
||||
this.expression = expression;
|
||||
|
@ -92,9 +90,9 @@ public class RuleDescriptionData implements Serializable {
|
|||
public void setScope(RuleScopeType scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getScopeLabel(){
|
||||
if(scope==null){
|
||||
|
||||
public String getScopeLabel() {
|
||||
if (scope == null) {
|
||||
return "";
|
||||
} else {
|
||||
return scope.getLabel();
|
||||
|
@ -116,7 +114,6 @@ public class RuleDescriptionData implements Serializable {
|
|||
public void setExpression(C_Expression expression) {
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
|
||||
public String getReadableExpression() {
|
||||
if (expression != null) {
|
||||
|
@ -126,6 +123,23 @@ public class RuleDescriptionData implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean equals(RuleDescriptionData ruleDescriptionData){
|
||||
if(ruleDescriptionData==null){
|
||||
return false;
|
||||
} else {
|
||||
if(id-ruleDescriptionData.getId()==0){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RuleDescriptionData [id=" + id + ", name=" + name
|
||||
|
@ -134,6 +148,4 @@ public class RuleDescriptionData implements Serializable {
|
|||
+ ", expression=" + expression + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue