Class QueryTemplateVersionClassifier
java.lang.Object
org.gcube.informationsystem.resourceregistry.queries.templates.QueryTemplateVersionClassifier
Classifies the difference between a persisted and a submitted Query Template definition and
derives the minimum
version advancement it requires: the Version Advancement rules of
PUT /query-templates/{name}. Both definitions are in the comparable form produced by
QueryTemplateDefinitionValidator.comparable(JsonNode).- Author:
- Luca Frosini (ISTI - CNR)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe version advancements, by increasing reach. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclassify(org.gcube.com.fasterxml.jackson.databind.JsonNode persisted, org.gcube.com.fasterxml.jackson.databind.JsonNode submitted) Returns the minimum advancement the difference between two definitions requires: the highest one required by any of their differences, at leastQueryTemplateVersionClassifier.Advancement.PATCH.org.gcube.informationsystem.utils.VersionlowestAccepted(org.gcube.informationsystem.utils.Version persisted, QueryTemplateVersionClassifier.Advancement advancement) Returns the lowest version that satisfies an advancement from the persisted version.
-
Constructor Details
-
QueryTemplateVersionClassifier
public QueryTemplateVersionClassifier()Creates a newQueryTemplateVersionClassifier.
-
-
Method Details
-
classify
public QueryTemplateVersionClassifier.Advancement classify(org.gcube.com.fasterxml.jackson.databind.JsonNode persisted, org.gcube.com.fasterxml.jackson.databind.JsonNode submitted) Returns the minimum advancement the difference between two definitions requires: the highest one required by any of their differences, at leastQueryTemplateVersionClassifier.Advancement.PATCH.- Parameters:
persisted- the comparable persisted definitionsubmitted- the comparable submitted definition- Returns:
- the minimum advancement
-
lowestAccepted
public org.gcube.informationsystem.utils.Version lowestAccepted(org.gcube.informationsystem.utils.Version persisted, QueryTemplateVersionClassifier.Advancement advancement) Returns the lowest version that satisfies an advancement from the persisted version.- Parameters:
persisted- the persisted versionadvancement- the required advancement- Returns:
- the lowest accepted version
-