-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sean Sundberg <[email protected]>
- Loading branch information
Showing
20 changed files
with
230 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/com/ibm/openpages/support/models/IObjectType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.ibm.openpages.support.models; | ||
|
||
public interface IObjectType { | ||
String name(); | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/ibm/openpages/support/models/ObjectType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.ibm.openpages.support.models; | ||
|
||
public class ObjectType implements IObjectType { | ||
private final String name; | ||
|
||
public ObjectType(String name) { | ||
this.name = name; | ||
} | ||
|
||
public static ObjectType from(String name) { | ||
return new ObjectType(name); | ||
} | ||
|
||
public String name() { | ||
return name; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/main/java/com/ibm/openpages/support/models/ResultValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.ibm.openpages.support.models; | ||
|
||
public interface ResultValue { | ||
String baseValue(); | ||
String value(); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/ibm/openpages/support/models/object_type/BusinessEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package com.ibm.openpages.support.models.object_type; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ObjectType; | ||
import com.ibm.openpages.support.models.field_group.MRG_BusEnt; | ||
import com.ibm.openpages.support.models.field_group.OPSS_BE; | ||
import com.ibm.openpages.support.models.field_group.OPSS_BusEnt; | ||
import com.ibm.openpages.support.models.field_group.SystemFields; | ||
|
||
public interface BusinessEntity extends SystemFields, MRG_BusEnt, OPSS_BE, OPSS_BusEnt { | ||
IObjectType type = new ObjectType("BusinessEntity"); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/ibm/openpages/support/models/object_type/Metric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package com.ibm.openpages.support.models.object_type; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ObjectType; | ||
import com.ibm.openpages.support.models.field_group.MRG_Metric; | ||
import com.ibm.openpages.support.models.field_group.MRG_Metric_Shared; | ||
import com.ibm.openpages.support.models.field_group.OPSS_Shared_Lib; | ||
import com.ibm.openpages.support.models.field_group.SystemFields; | ||
|
||
public interface Metric extends SystemFields, MRG_Metric, MRG_Metric_Shared, OPSS_Shared_Lib { | ||
IObjectType type = new ObjectType("Metric"); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/ibm/openpages/support/models/object_type/MetricValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package com.ibm.openpages.support.models.object_type; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ObjectType; | ||
import com.ibm.openpages.support.models.field_group.MRG_MetricVal; | ||
import com.ibm.openpages.support.models.field_group.MRG_Metric_Shared; | ||
import com.ibm.openpages.support.models.field_group.SystemFields; | ||
|
||
public interface MetricValue extends SystemFields, MRG_Metric_Shared, MRG_MetricVal { | ||
IObjectType type = new ObjectType("MetricValue"); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/ibm/openpages/support/models/object_type/Model.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package com.ibm.openpages.support.models.object_type; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ObjectType; | ||
import com.ibm.openpages.support.models.field_group.*; | ||
|
||
public interface Model extends SystemFields, Integration, IntegrationWKC, MRG_AIFacts_Model, MRG_Model, MRG_MTS_Shared, MRG_UserFact_Model { | ||
IObjectType type = new ObjectType("Model"); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/ibm/openpages/support/models/object_type/ModelRiskScorecard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package com.ibm.openpages.support.models.object_type; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ObjectType; | ||
import com.ibm.openpages.support.models.field_group.MRG_MTS; | ||
import com.ibm.openpages.support.models.field_group.MRG_MTS_Shared; | ||
import com.ibm.openpages.support.models.field_group.SystemFields; | ||
|
||
public interface ModelRiskScorecard extends SystemFields, MRG_MTS, MRG_MTS_Shared { | ||
IObjectType type = new ObjectType("ModelRiskScorecard"); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/ibm/openpages/support/models/object_type/ModelUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package com.ibm.openpages.support.models.object_type; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ObjectType; | ||
import com.ibm.openpages.support.models.field_group.*; | ||
|
||
public interface ModelUseCase extends SystemFields, Integration, IntegrationWKC, MRG_AIFacts_ModelUseCase, MRG_ModelUseCase, MRG_UserFact_ModelUseCase, Watsonx_UseCaseChecklist { | ||
IObjectType type = new ObjectType("ModelUseCase"); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/ibm/openpages/support/models/object_type/QuestionnaireAssessment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package com.ibm.openpages.support.models.object_type; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ObjectType; | ||
import com.ibm.openpages.support.models.field_group.*; | ||
|
||
public interface QuestionnaireAssessment extends SystemFields, OPLC_QAssessment, OPLC_Std, OPSS_QAssessment, Watsonx_QAssessment { | ||
IObjectType type = new ObjectType("QuestionnaireAssessment"); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/ibm/openpages/support/models/object_type/QuestionnaireTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package com.ibm.openpages.support.models.object_type; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ObjectType; | ||
import com.ibm.openpages.support.models.field_group.*; | ||
|
||
public interface QuestionnaireTemplate extends SystemFields, OPLC_Owners, OPSS_Qtemp, OPSS_Qtemp_Config, OPSS_Qtemp_Shared { | ||
IObjectType type = new ObjectType("QuestionnaireTemplate"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/com/ibm/openpages/support/util/query/AndQueryClause.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.ibm.openpages.support.util.query; | ||
|
||
import com.sun.org.apache.xpath.internal.operations.Or; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class AndQueryClause extends GroupQueryClause { | ||
private final List<QueryClause> clauses; | ||
|
||
protected AndQueryClause() { | ||
this(new ArrayList<>()); | ||
} | ||
protected AndQueryClause(QueryClause... clauses) { | ||
this(Arrays.asList(clauses)); | ||
} | ||
protected AndQueryClause(List<QueryClause> clauses) { | ||
this.clauses = clauses; | ||
} | ||
|
||
@Override | ||
public boolean isAnd() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void add(QueryClause clause) { | ||
clauses.add(clause); | ||
} | ||
|
||
@Override | ||
public String toClause() { | ||
return "(" + clauses.stream().map(QueryClause::toClause).collect(Collectors.joining(" AND ")) + ")"; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/ibm/openpages/support/util/query/GroupQueryClause.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.ibm.openpages.support.util.query; | ||
|
||
public abstract class GroupQueryClause extends QueryClause { | ||
|
||
public boolean isAnd() { | ||
return false; | ||
} | ||
public boolean isOr() { | ||
return false; | ||
} | ||
|
||
public abstract void add(QueryClause clause); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/ibm/openpages/support/util/query/Operation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.ibm.openpages.support.util.query; | ||
|
||
public enum Operation { | ||
EQUAL("="); | ||
|
||
private final String value; | ||
|
||
Operation(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String value() { | ||
return value; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/com/ibm/openpages/support/util/query/OrQueryClause.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.ibm.openpages.support.util.query; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class OrQueryClause extends GroupQueryClause { | ||
private final List<QueryClause> clauses; | ||
|
||
protected OrQueryClause() { | ||
this(new ArrayList<>()); | ||
} | ||
protected OrQueryClause(QueryClause... clauses) { | ||
this(Arrays.asList(clauses)); | ||
} | ||
protected OrQueryClause(List<QueryClause> clauses) { | ||
this.clauses = clauses; | ||
} | ||
|
||
@Override | ||
public boolean isOr() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void add(QueryClause clause) { | ||
clauses.add(clause); | ||
} | ||
|
||
@Override | ||
public String toClause() { | ||
return "(" + clauses.stream().map(QueryClause::toClause).collect(Collectors.joining(" OR ")) + ")"; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/com/ibm/openpages/support/util/query/QueryClause.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.ibm.openpages.support.util.query; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ResultValue; | ||
|
||
public abstract class QueryClause { | ||
|
||
public static QueryClause where(IObjectType type, ResultValue field, Operation operation, Object value) { | ||
return new SimpleQueryClause(type, field, operation, value); | ||
} | ||
|
||
public QueryClause and(IObjectType type, ResultValue field, Operation operation, Object value) { | ||
return and(new SimpleQueryClause(type, field, operation, value)); | ||
} | ||
|
||
public QueryClause and(QueryClause clause) { | ||
if (this instanceof GroupQueryClause && ((GroupQueryClause)this).isAnd()) { | ||
final GroupQueryClause groupClause = (GroupQueryClause)this; | ||
|
||
groupClause.add(clause); | ||
|
||
return this; | ||
} | ||
|
||
return new AndQueryClause(this, clause); | ||
} | ||
|
||
public QueryClause or(IObjectType type, ResultValue field, Operation operation, Object value) { | ||
return or(new SimpleQueryClause(type, field, operation, value)); | ||
} | ||
|
||
public QueryClause or(QueryClause clause) { | ||
if (this instanceof GroupQueryClause && ((GroupQueryClause)this).isOr()) { | ||
final GroupQueryClause groupClause = (GroupQueryClause)this; | ||
|
||
groupClause.add(clause); | ||
|
||
return this; | ||
} | ||
|
||
return new OrQueryClause(this, clause); | ||
} | ||
|
||
public abstract String toClause(); | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/ibm/openpages/support/util/query/SimpleQueryClause.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.ibm.openpages.support.util.query; | ||
|
||
import com.ibm.openpages.support.models.IObjectType; | ||
import com.ibm.openpages.support.models.ResultValue; | ||
|
||
public class SimpleQueryClause extends QueryClause { | ||
private final IObjectType type; | ||
private final ResultValue field; | ||
private final Operation operation; | ||
private final Object value; | ||
|
||
protected SimpleQueryClause(IObjectType type, ResultValue field, Operation operation, Object value) { | ||
this.type = type; | ||
this.field = field; | ||
this.operation = operation; | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public String toClause() { | ||
return "[" + type.name() + "].[" + field.baseValue() + "] " + operation.value() + " " + value; | ||
} | ||
} |