Skip to content

Commit

Permalink
Fixes to data model version 1.2.11 (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Vorobiev authored Feb 3, 2021
1 parent 50671fa commit 52a2221
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class SampledFunctionParameterType extends ParameterType implements Clone
public SampledFunctionParameterType() {
this.dependentParameterType = new ArrayList<OrderedItem>();
this.independentParameterType = new ArrayList<OrderedItem>();
this.interpolationPeriod = new ArrayList<String>();
this.interpolationPeriod = new ValueArray<String>(String.class);
}

/**
Expand All @@ -82,7 +82,7 @@ public SampledFunctionParameterType(UUID iid, int rev) {
super(iid, rev);
this.dependentParameterType = new ArrayList<OrderedItem>();
this.independentParameterType = new ArrayList<OrderedItem>();
this.interpolationPeriod = new ArrayList<String>();
this.interpolationPeriod = new ValueArray<String>(String.class);
}

/**
Expand Down Expand Up @@ -113,13 +113,13 @@ public SampledFunctionParameterType(UUID iid, int rev) {
private ArrayList<OrderedItem> 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<String> interpolationPeriod;
private ValueArray<String> interpolationPeriod;

/**
* Gets the route for the current {@link SampledFunctionParameterType}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class SampledFunctionParameterType extends ParameterType implements Clone
public SampledFunctionParameterType() {
this.dependentParameterType = new OrderedItemList<DependentParameterTypeAssignment>(this, true, DependentParameterTypeAssignment.class);
this.independentParameterType = new OrderedItemList<IndependentParameterTypeAssignment>(this, true, IndependentParameterTypeAssignment.class);
this.interpolationPeriod = new ArrayList<String>();
this.interpolationPeriod = new ValueArray<String>(this, String.class);
}

/**
Expand All @@ -99,7 +99,7 @@ public SampledFunctionParameterType(UUID iid, Cache<CacheKey, Thing> cache, URI
super(iid, cache, iDalUri);
this.dependentParameterType = new OrderedItemList<DependentParameterTypeAssignment>(this, true, DependentParameterTypeAssignment.class);
this.independentParameterType = new OrderedItemList<IndependentParameterTypeAssignment>(this, true, IndependentParameterTypeAssignment.class);
this.interpolationPeriod = new ArrayList<String>();
this.interpolationPeriod = new ValueArray<String>(this, String.class);
}

/**
Expand Down Expand Up @@ -131,15 +131,15 @@ public SampledFunctionParameterType(UUID iid, Cache<CacheKey, Thing> cache, URI
private OrderedItemList<IndependentParameterTypeAssignment> 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 <i>independentParameterType</i> property. An empty value means no cyclic interpolation for the corresponding <i>independentParameterType</i>.
* 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<String> interpolationPeriod;
private ValueArray<String> interpolationPeriod;

/**
* {@link Iterable} that references the composite properties of the current {@link SampledFunctionParameterType}.
Expand Down Expand Up @@ -182,7 +182,7 @@ protected Thing genericClone(boolean cloneContainedThings) {
clone.setExcludedPerson(new ArrayList<Person>(this.getExcludedPerson()));
clone.setHyperLink(cloneContainedThings ? new ContainerList<HyperLink>(clone) : new ContainerList<HyperLink>(this.getHyperLink(), clone, false));
clone.setIndependentParameterType(cloneContainedThings ? null : new OrderedItemList<IndependentParameterTypeAssignment>(this.getIndependentParameterType(), clone, IndependentParameterTypeAssignment.class));
clone.setInterpolationPeriod(new ArrayList<String>(this.getInterpolationPeriod()));
clone.setInterpolationPeriod(new ValueArray<String>(this.getInterpolationPeriod(), this, String.class));

if (cloneContainedThings) {
clone.getAlias().addAll(this.getAlias().stream().map(x -> x.clone(true)).collect(Collectors.toList()));
Expand Down Expand Up @@ -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<String>(dto.getInterpolationPeriod(), this, String.class));
this.setDeprecated(dto.isDeprecated());
this.setModifiedOn(dto.getModifiedOn());
this.setName(dto.getName());
Expand Down Expand Up @@ -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<String>(this.getInterpolationPeriod(), this, String.class));
dto.setDeprecated(this.isDeprecated());
dto.setModifiedOn(this.getModifiedOn());
dto.setName(this.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 52a2221

Please sign in to comment.