Skip to content

Commit

Permalink
PB-25843 Referenced Conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
x_MacieMi1 authored and john committed Jun 13, 2019
1 parent 6a2cab0 commit 3f2687c
Show file tree
Hide file tree
Showing 23 changed files with 1,182 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.silanis.esl.api.model;

import static com.silanis.esl.api.util.SchemaSanitizer.throwOnNull;
import static com.silanis.esl.api.util.SchemaSanitizer.trim;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.io.Serializable;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
public class ReferencedConditions extends Model implements Serializable {

@JsonIgnore
public static final String PACKAGE_ID = "packageId";
@JsonIgnore
public static final String REF_DOCUMENTS = "documents";

private String packageId;
private List<ReferencedDocument> documents;

public ReferencedConditions setPackageId(String value) {

throwOnNull(PACKAGE_ID, value);
value = trim(value);

this.packageId = value;
setDirty(PACKAGE_ID);
return this;
}

public String getPackageId() {
return packageId;
}

public ReferencedConditions setDocuments(List<ReferencedDocument> value) {

throwOnNull(REF_DOCUMENTS, value);

this.documents = value;
setDirty(REF_DOCUMENTS);
return this;
}

public List<ReferencedDocument> getDocuments() {
return documents;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.silanis.esl.api.model;

import static com.silanis.esl.api.util.SchemaSanitizer.throwOnNull;
import static com.silanis.esl.api.util.SchemaSanitizer.trim;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.io.Serializable;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
public class ReferencedDocument extends Model implements Serializable {

@JsonIgnore
public static final String FIELD_ID = "documentId";
@JsonIgnore
public static final String REF_FIELDS = "fields";

private String documentId;
private List<ReferencedField> fields;

public ReferencedDocument setDocumentId(String value) {

throwOnNull(FIELD_ID, value);
value = trim(value);

this.documentId = value;
setDirty(FIELD_ID);
return this;
}

public String getDocumentId() {
return documentId;
}

public ReferencedDocument setFields(List<ReferencedField> value) {

throwOnNull(REF_FIELDS, value);

this.fields = value;
setDirty(REF_FIELDS);
return this;
}

public List<ReferencedField> getFields() {
return fields;
}
}

47 changes: 47 additions & 0 deletions sdk/src/main/java/com/silanis/esl/api/model/ReferencedField.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.silanis.esl.api.model;

import static com.silanis.esl.api.util.SchemaSanitizer.throwOnNull;
import static com.silanis.esl.api.util.SchemaSanitizer.trim;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.io.Serializable;

@JsonIgnoreProperties(ignoreUnknown = true)
public class ReferencedField extends Model implements Serializable {

@JsonIgnore
public static final String FIELD_ID = "fieldId";
@JsonIgnore
public static final String REF_CONDITIONS = "conditions";

private String fieldId;
private ReferencedFieldConditions conditions;

public ReferencedField setFieldId(String value) {

throwOnNull(FIELD_ID, value);
value = trim(value);

this.fieldId = value;
setDirty(FIELD_ID);
return this;
}

public String getFieldId() {
return fieldId;
}

public ReferencedField setConditions(ReferencedFieldConditions value) {

throwOnNull(REF_CONDITIONS, value);

this.conditions = value;
setDirty(REF_CONDITIONS);
return this;
}

public ReferencedFieldConditions getConditions() {
return conditions;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.silanis.esl.api.model;

import static com.silanis.esl.api.util.SchemaSanitizer.throwOnNull;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.io.Serializable;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
public class ReferencedFieldConditions extends Model implements Serializable {

@JsonIgnore
public static final String REF_IN_CONDITION = "referencedInCondition";
@JsonIgnore
public static final String REF_IN_ACTION = "referencedInAction";

private List<FieldCondition> referencedInCondition;
private List<FieldCondition> referencedInAction;

public ReferencedFieldConditions() {
}

public ReferencedFieldConditions(List<FieldCondition> referencedInCondition, List<FieldCondition> referencedInAction) {
this.referencedInCondition = referencedInCondition;
this.referencedInAction = referencedInAction;
}

public ReferencedFieldConditions setReferencedInCondition(List<FieldCondition> value) {

throwOnNull(REF_IN_CONDITION, value);

this.referencedInCondition = value;
setDirty(REF_IN_CONDITION);
return this;
}

public List<FieldCondition> getReferencedInCondition() {
return referencedInCondition;
}

public ReferencedFieldConditions setReferencedInAction(List<FieldCondition> value) {

throwOnNull(REF_IN_ACTION, value);

this.referencedInAction = value;
setDirty(REF_IN_ACTION);
return this;
}

public List<FieldCondition> getReferencedInAction() {
return referencedInAction;
}
}
25 changes: 25 additions & 0 deletions sdk/src/main/java/com/silanis/esl/sdk/ReferencedConditions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.silanis.esl.sdk;

import java.util.List;

public class ReferencedConditions {

private String packageId;
private List<ReferencedDocument> documents;

public String getPackageId() {
return packageId;
}

public void setPackageId(String packageId) {
this.packageId = packageId;
}

public List<ReferencedDocument> getDocuments() {
return documents;
}

public void setDocuments(List<ReferencedDocument> documents) {
this.documents = documents;
}
}
25 changes: 25 additions & 0 deletions sdk/src/main/java/com/silanis/esl/sdk/ReferencedDocument.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.silanis.esl.sdk;

import java.util.List;

public class ReferencedDocument {

private String documentId;
private List<ReferencedField> fields;

public String getDocumentId() {
return documentId;
}

public void setDocumentId(String documentId) {
this.documentId = documentId;
}

public List<ReferencedField> getFields() {
return fields;
}

public void setFields(List<ReferencedField> fields) {
this.fields = fields;
}
}
23 changes: 23 additions & 0 deletions sdk/src/main/java/com/silanis/esl/sdk/ReferencedField.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.silanis.esl.sdk;

public class ReferencedField {

private String fieldId;
private ReferencedFieldConditions conditions;

public String getFieldId() {
return fieldId;
}

public void setFieldId(String fieldId) {
this.fieldId = fieldId;
}

public ReferencedFieldConditions getConditions() {
return conditions;
}

public void setConditions(ReferencedFieldConditions conditions) {
this.conditions = conditions;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.silanis.esl.sdk;

import java.util.List;

public class ReferencedFieldConditions {

private List<FieldCondition> referencedInCondition;
private List<FieldCondition> referencedInAction;

public List<FieldCondition> getReferencedInCondition() {
return referencedInCondition;
}

public void setReferencedInCondition(List<FieldCondition> referencedInCondition) {
this.referencedInCondition = referencedInCondition;
}

public List<FieldCondition> getReferencedInAction() {
return referencedInAction;
}

public void setReferencedInAction(List<FieldCondition> referencedInAction) {
this.referencedInAction = referencedInAction;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.silanis.esl.sdk.builder;

import com.silanis.esl.sdk.FieldCondition;

public class FieldConditionBuilder {

private String id;
private String condition;
private String action;

public static FieldConditionBuilder newFieldCondition() {
return new FieldConditionBuilder();
}

public FieldConditionBuilder withId(String id) {
this.id = id;
return this;
}

public FieldConditionBuilder withCondition(String condition) {
this.condition = condition;
return this;
}

public FieldConditionBuilder withAction(String action) {
this.action = action;
return this;
}

public FieldCondition build() {
FieldCondition fieldCondition = new FieldCondition();
fieldCondition.setId(this.id);
fieldCondition.setCondition(this.condition);
fieldCondition.setAction(this.action);
return fieldCondition;
}
}
Loading

0 comments on commit 3f2687c

Please sign in to comment.