-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Story/586/t3736/newdatastruc #702
Closed
Closed
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1f21c82
task-3736: new data structure
PayalKhanna 724207b
task-3736: add getters
PayalKhanna e1f3e3d
Merge branch 'master' into story/586/t3736/newdatastruc
PayalKhanna 48736c9
task-3736: fixing type and missing extends
PayalKhanna e7545b4
Merge branch 'master' into story/586/t3736/newdatastruc
PayalKhanna 8a0121a
task-3736: added Deprecation
PayalKhanna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
rosetta-runtime/src/main/java/com/rosetta/model/lib/validation/AttributeValidation.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,34 @@ | ||
package com.rosetta.model.lib.validation; | ||
|
||
import java.util.List; | ||
|
||
public class AttributeValidation { | ||
private String attributeName; | ||
private String modelURI; | ||
private ValidationResult cardinalityValidation; | ||
|
||
private List<ValidationResult> itemValidations; | ||
|
||
public AttributeValidation(String attributeName, String modelURI, ValidationResult cardinalityValidation, List<ValidationResult> itemValidations) { | ||
this.attributeName = attributeName; | ||
this.modelURI = modelURI; | ||
this.cardinalityValidation = cardinalityValidation; | ||
this.itemValidations = itemValidations; | ||
} | ||
|
||
public String getAttributeName() { | ||
return attributeName; | ||
} | ||
|
||
public String getModelURI() { | ||
return modelURI; | ||
} | ||
|
||
public ValidationResult getCardinalityValidation() { | ||
return cardinalityValidation; | ||
} | ||
|
||
public List<ValidationResult> getItemValidations() { | ||
return itemValidations; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...tta-runtime/src/main/java/com/rosetta/model/lib/validation/CardinalityValidationData.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,26 @@ | ||
package com.rosetta.model.lib.validation; | ||
|
||
public class CardinalityValidationData extends ValidationData{ | ||
|
||
private int lowerBound; | ||
private int upperBound; | ||
private int actual; | ||
|
||
public CardinalityValidationData(int lowerBound, int upperBound, int actual) { | ||
this.lowerBound = lowerBound; | ||
this.upperBound = upperBound; | ||
this.actual = actual; | ||
} | ||
|
||
public int getLowerBound() { | ||
return lowerBound; | ||
} | ||
|
||
public int getUpperBound() { | ||
return upperBound; | ||
} | ||
|
||
public int getActual() { | ||
return actual; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
rosetta-runtime/src/main/java/com/rosetta/model/lib/validation/ConditionValidation.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.rosetta.model.lib.validation; | ||
|
||
import java.util.List; | ||
|
||
public class ConditionValidation { | ||
private String attributeName; | ||
private String modelURI; | ||
|
||
private ValidationResult cardinalityValidation; | ||
|
||
private List<ValidationResult> itemValidations; | ||
|
||
public ConditionValidation(String attributeName, String modelURI, ValidationResult cardinalityValidation, List<ValidationResult> itemValidations) { | ||
this.attributeName = attributeName; | ||
this.modelURI = modelURI; | ||
this.cardinalityValidation = cardinalityValidation; | ||
this.itemValidations = itemValidations; | ||
} | ||
|
||
public String getAttributeName() { | ||
return attributeName; | ||
} | ||
|
||
public String getModelURI() { | ||
return modelURI; | ||
} | ||
|
||
public ValidationResult getCardinalityValidation() { | ||
return cardinalityValidation; | ||
} | ||
|
||
public List<ValidationResult> getItemValidations() { | ||
return itemValidations; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
rosetta-runtime/src/main/java/com/rosetta/model/lib/validation/ConditionValidationData.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,4 @@ | ||
package com.rosetta.model.lib.validation; | ||
|
||
public class ConditionValidationData extends ValidationData{ | ||
} |
39 changes: 39 additions & 0 deletions
39
rosetta-runtime/src/main/java/com/rosetta/model/lib/validation/NumberValidationData.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,39 @@ | ||
package com.rosetta.model.lib.validation; | ||
|
||
import java.math.BigDecimal; | ||
|
||
public class NumberValidationData extends ValidationData{ | ||
private BigDecimal min; | ||
private BigDecimal max; | ||
private int digits; | ||
private int fractionalDigits; | ||
private BigDecimal actual; | ||
|
||
public NumberValidationData(BigDecimal min, BigDecimal max, int digits, int fractionalDigits, BigDecimal actual) { | ||
this.min = min; | ||
this.max = max; | ||
this.digits = digits; | ||
this.fractionalDigits = fractionalDigits; | ||
this.actual = actual; | ||
} | ||
|
||
public BigDecimal getMin() { | ||
return min; | ||
} | ||
|
||
public BigDecimal getMax() { | ||
return max; | ||
} | ||
|
||
public int getDigits() { | ||
return digits; | ||
} | ||
|
||
public int getFractionalDigits() { | ||
return fractionalDigits; | ||
} | ||
|
||
public BigDecimal getActual() { | ||
return actual; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
rosetta-runtime/src/main/java/com/rosetta/model/lib/validation/StringValidationData.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,34 @@ | ||
package com.rosetta.model.lib.validation; | ||
|
||
import java.util.regex.Pattern; | ||
|
||
public class StringValidationData extends ValidationData{ | ||
|
||
private int minLength; | ||
private int maxLength; | ||
private Pattern pattern; | ||
private String actual; | ||
|
||
public StringValidationData(int minLength, int maxLength, Pattern pattern, String actual) { | ||
this.minLength = minLength; | ||
this.maxLength = maxLength; | ||
this.pattern = pattern; | ||
this.actual = actual; | ||
} | ||
|
||
public int getMinLength() { | ||
return minLength; | ||
} | ||
|
||
public int getMaxLength() { | ||
return maxLength; | ||
} | ||
|
||
public Pattern getPattern() { | ||
return pattern; | ||
} | ||
|
||
public String getActual() { | ||
return actual; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
rosetta-runtime/src/main/java/com/rosetta/model/lib/validation/TypeValidation.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,38 @@ | ||
package com.rosetta.model.lib.validation; | ||
|
||
import com.rosetta.model.lib.ModelSymbolId; | ||
|
||
import java.util.List; | ||
|
||
public class TypeValidation extends ValidationData { | ||
|
||
private final ModelSymbolId typeID; | ||
|
||
private final List<ValidationResult> formatValidations; | ||
private final List<AttributeValidation> attributeValidations; | ||
private final List<ConditionValidation> conditionValidation; | ||
|
||
|
||
public TypeValidation(ModelSymbolId typeID, List<ValidationResult> formatValidations, List<AttributeValidation> attributeValidations, List<ConditionValidation> conditionValidation) { | ||
this.typeID = typeID; | ||
this.formatValidations = formatValidations; | ||
this.attributeValidations = attributeValidations; | ||
this.conditionValidation = conditionValidation; | ||
} | ||
|
||
public ModelSymbolId getTypeID() { | ||
return typeID; | ||
} | ||
|
||
public List<ValidationResult> getFormatValidations() { | ||
return formatValidations; | ||
} | ||
|
||
public List<AttributeValidation> getAttributeValidations() { | ||
return attributeValidations; | ||
} | ||
|
||
public List<ConditionValidation> getConditionValidation() { | ||
return conditionValidation; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
rosetta-runtime/src/main/java/com/rosetta/model/lib/validation/ValidationData.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,4 @@ | ||
package com.rosetta.model.lib.validation; | ||
|
||
public class ValidationData { | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, I think we should name this
typeId