diff --git a/cdp4common/src/main/java/cdp4common/dto/SampledFunctionParameterType.java b/cdp4common/src/main/java/cdp4common/dto/SampledFunctionParameterType.java index 1f0dcaa..b4301e5 100644 --- a/cdp4common/src/main/java/cdp4common/dto/SampledFunctionParameterType.java +++ b/cdp4common/src/main/java/cdp4common/dto/SampledFunctionParameterType.java @@ -69,7 +69,7 @@ public class SampledFunctionParameterType extends ParameterType implements Clone public SampledFunctionParameterType() { this.dependentParameterType = new ArrayList(); this.independentParameterType = new ArrayList(); - this.interpolationPeriod = new ArrayList(); + this.interpolationPeriod = new ValueArray(String.class); } /** @@ -82,7 +82,7 @@ public SampledFunctionParameterType(UUID iid, int rev) { super(iid, rev); this.dependentParameterType = new ArrayList(); this.independentParameterType = new ArrayList(); - this.interpolationPeriod = new ArrayList(); + this.interpolationPeriod = new ValueArray(String.class); } /** @@ -113,13 +113,13 @@ public SampledFunctionParameterType(UUID iid, int rev) { private ArrayList independentParameterType; /** - * The list of String. + * The list of ordered String. */ - @UmlInformation(aggregation = AggregationKind.NONE, isDerived = false, isOrdered = false, isNullable = false, isPersistent = true) + @UmlInformation(aggregation = AggregationKind.NONE, isDerived = false, isOrdered = true, isNullable = false, isPersistent = true) @DataMember @Getter @Setter - private ArrayList interpolationPeriod; + private ValueArray interpolationPeriod; /** * Gets the route for the current {@link SampledFunctionParameterType}. diff --git a/cdp4common/src/main/java/cdp4common/sitedirectorydata/SampledFunctionParameterType.java b/cdp4common/src/main/java/cdp4common/sitedirectorydata/SampledFunctionParameterType.java index 17f4ae2..db83af7 100644 --- a/cdp4common/src/main/java/cdp4common/sitedirectorydata/SampledFunctionParameterType.java +++ b/cdp4common/src/main/java/cdp4common/sitedirectorydata/SampledFunctionParameterType.java @@ -84,7 +84,7 @@ public class SampledFunctionParameterType extends ParameterType implements Clone public SampledFunctionParameterType() { this.dependentParameterType = new OrderedItemList(this, true, DependentParameterTypeAssignment.class); this.independentParameterType = new OrderedItemList(this, true, IndependentParameterTypeAssignment.class); - this.interpolationPeriod = new ArrayList(); + this.interpolationPeriod = new ValueArray(this, String.class); } /** @@ -99,7 +99,7 @@ public SampledFunctionParameterType(UUID iid, Cache cache, URI super(iid, cache, iDalUri); this.dependentParameterType = new OrderedItemList(this, true, DependentParameterTypeAssignment.class); this.independentParameterType = new OrderedItemList(this, true, IndependentParameterTypeAssignment.class); - this.interpolationPeriod = new ArrayList(); + this.interpolationPeriod = new ValueArray(this, String.class); } /** @@ -131,15 +131,15 @@ public SampledFunctionParameterType(UUID iid, Cache cache, URI private OrderedItemList independentParameterType; /** - * List of String. + * List of ordered String. * optional representation of a period in case of a cyclic function to be taken into account for interpolation * Note: The number of values shall be equal to the number of parameter types in the independentParameterType property. An empty value means no cyclic interpolation for the corresponding independentParameterType. * Example: The function could represent the incident albedo flux as a function of mission elapsed time for a spacecraft in a circular orbit. */ - @UmlInformation(aggregation = AggregationKind.NONE, isDerived = false, isOrdered = false, isNullable = false, isPersistent = true) + @UmlInformation(aggregation = AggregationKind.NONE, isDerived = false, isOrdered = true, isNullable = false, isPersistent = true) @Getter @Setter - private ArrayList interpolationPeriod; + private ValueArray interpolationPeriod; /** * {@link Iterable} that references the composite properties of the current {@link SampledFunctionParameterType}. @@ -182,7 +182,7 @@ protected Thing genericClone(boolean cloneContainedThings) { clone.setExcludedPerson(new ArrayList(this.getExcludedPerson())); clone.setHyperLink(cloneContainedThings ? new ContainerList(clone) : new ContainerList(this.getHyperLink(), clone, false)); clone.setIndependentParameterType(cloneContainedThings ? null : new OrderedItemList(this.getIndependentParameterType(), clone, IndependentParameterTypeAssignment.class)); - clone.setInterpolationPeriod(new ArrayList(this.getInterpolationPeriod())); + clone.setInterpolationPeriod(new ValueArray(this.getInterpolationPeriod(), this, String.class)); if (cloneContainedThings) { clone.getAlias().addAll(this.getAlias().stream().map(x -> x.clone(true)).collect(Collectors.toList())); @@ -259,7 +259,7 @@ public void resolveProperties(cdp4common.dto.Thing dtoThing) { PojoThingFactory.resolveList(this.getExcludedPerson(), dto.getExcludedPerson(), dto.getIterationContainerId(), this.getCache(), Person.class); PojoThingFactory.resolveList(this.getHyperLink(), dto.getHyperLink(), dto.getIterationContainerId(), this.getCache(), HyperLink.class); PojoThingFactory.resolveList(this.getIndependentParameterType(), dto.getIndependentParameterType(), dto.getIterationContainerId(), this.getCache(), IndependentParameterTypeAssignment.class); - PojoThingFactory.clearAndAddRange(this.getInterpolationPeriod(), dto.getInterpolationPeriod()); + this.setInterpolationPeriod(new ValueArray(dto.getInterpolationPeriod(), this, String.class)); this.setDeprecated(dto.isDeprecated()); this.setModifiedOn(dto.getModifiedOn()); this.setName(dto.getName()); @@ -289,7 +289,7 @@ public cdp4common.dto.Thing toDto() { dto.getExcludedPerson().addAll(this.getExcludedPerson().stream().map(Thing::getIid).collect(Collectors.toList())); dto.getHyperLink().addAll(this.getHyperLink().stream().map(Thing::getIid).collect(Collectors.toList())); dto.getIndependentParameterType().addAll(this.getIndependentParameterType().toDtoOrderedItemList()); - dto.getInterpolationPeriod().addAll(this.getInterpolationPeriod()); + dto.setInterpolationPeriod(new ValueArray(this.getInterpolationPeriod(), this, String.class)); dto.setDeprecated(this.isDeprecated()); dto.setModifiedOn(this.getModifiedOn()); dto.setName(this.getName()); diff --git a/cdp4emfconnector/src/main/java/cdp4emfconnector/SampledFunctionParameterType.java b/cdp4emfconnector/src/main/java/cdp4emfconnector/SampledFunctionParameterType.java index d3d0453..98c14ad 100644 --- a/cdp4emfconnector/src/main/java/cdp4emfconnector/SampledFunctionParameterType.java +++ b/cdp4emfconnector/src/main/java/cdp4emfconnector/SampledFunctionParameterType.java @@ -85,7 +85,8 @@ public static CDP4.SiteDirectoryData.SampledFunctionParameterType toEmf(cdp4comm emf.getIndependentParameterType().addAll(thing.getIndependentParameterType().stream().map(item -> cdp4emfconnector.IndependentParameterTypeAssignment.toEmf(item)).collect(Collectors.toList())); - thing.getInterpolationPeriod().forEach(item -> emf.getInterpolationPeriod().add(item.toString())); + thing.getInterpolationPeriod().forEach(item -> emf.getInterpolationPeriod().add(item)); + emf.setIsDeprecated(thing.isDeprecated()); emf.setModifiedOn(thing.getModifiedOn()); @@ -132,7 +133,8 @@ public static cdp4common.sitedirectorydata.SampledFunctionParameterType toPojo(C pojo.getIndependentParameterType().addAll(emfThing.getIndependentParameterType().stream().map(item -> cdp4emfconnector.IndependentParameterTypeAssignment.toPojo(item)).collect(Collectors.toList())); - emfThing.getInterpolationPeriod().forEach(item -> pojo.getInterpolationPeriod().add(UUID.fromString(item.toString()))); + emfThing.getInterpolationPeriod().forEach(item -> pojo.getInterpolationPeriod().set(item.indexOf(item), item)); + pojo.setDeprecated(emfThing.getIsDeprecated()); pojo.setModifiedOn(emfThing.getModifiedOn());