Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions .idea/jarRepositories.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

8 changes: 8 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@
<artifactId>jackson-databind</artifactId>
</dependency>

<!-- Source: https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.46</version>
<scope>compile</scope>
</dependency>

<!-- Unit tesing -->
<dependency>
<groupId>junit</groupId>
Expand Down
6 changes: 2 additions & 4 deletions api/src/main/java/info/rexs/io/RexsIoFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import info.rexs.io.xml.RexsXmlFileWriter;
import info.rexs.io.zip.RexsZipFileReader;
import info.rexs.io.zip.RexsZipFileWriter;
import lombok.Getter;

@Getter
public enum RexsIoFormat {

JSON("rexsj", "rexs.json") {
Expand Down Expand Up @@ -68,10 +70,6 @@ public AbstractRexsFileReader createNewFileReader(Resource rexsInputFileResource

private final String[] endings;

public String[] getEndings() {
return endings;
}

public boolean hasEnding(String filename) {
if (filename == null)
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Accumulation {
@JsonProperty("components")
private List<Component> components = new ArrayList<>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("components")
public List<Component> getComponents() {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/info/rexs/io/json/model/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class Component {
@JsonProperty("attributes")
private List<Attribute> attributes = new ArrayList<>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("id")
public Integer getId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class FloatingPointArrayCoded {
@JsonProperty("value")
private String value;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("code")
public String getCode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FloatingPointMatrixCoded {
@JsonProperty("value")
private String value;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("code")
public String getCode() {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/info/rexs/io/json/model/JSONModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class JSONModel {
@JsonProperty("model")
private Model model;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("model")
public Model getModel() {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/info/rexs/io/json/model/LoadCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class LoadCase {
@JsonProperty("components")
private List<Component> components = new ArrayList<>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("id")
public Integer getId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class LoadSpectrum {
@JsonProperty("accumulation")
private Accumulation accumulation;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("id")
public Integer getId() {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/info/rexs/io/json/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Model {
@JsonProperty("load_spectrum")
private LoadSpectrum loadSpectrum;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("version")
public String getVersion() {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/info/rexs/io/json/model/Ref.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Ref {
@JsonProperty("hint")
private String hint;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("id")
public Integer getId() {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/info/rexs/io/json/model/Relation.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Relation {
@JsonProperty("refs")
private List<Ref> refs = new ArrayList<>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("id")
public Integer getId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FloatingPointAttribute extends Attribute{
@JsonProperty("floating_point")
private Double floatingPoint;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
private final Map<String, Object> additionalProperties = new HashMap<>();

@JsonProperty("floating_point")
public Double getFloatingPoint() {
Expand Down
65 changes: 23 additions & 42 deletions api/src/main/java/info/rexs/model/RexsAttribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@
import java.util.List;
import java.util.Objects;

import info.rexs.schema.constants.RexsAttributeId;
import info.rexs.schema.constants.RexsUnitId;
import info.rexs.schema.constants.RexsValueType;
import info.rexs.schema.constants.standard.RexsStandardAttributeIds;
import info.rexs.schema.constants.standard.RexsStandardUnitIds;
import info.rexs.model.value.AbstractRexsAttributeValue;
import info.rexs.model.value.RexsAttributeValueArray;
import info.rexs.model.value.RexsAttributeValueArrayBase64;
import info.rexs.model.value.RexsAttributeValueArrayOfArrays;
import info.rexs.model.value.RexsAttributeValueMatrix;
import info.rexs.model.value.RexsAttributeValueMatrixBase64;
import info.rexs.model.value.RexsAttributeValueScalar;
import info.rexs.schema.constants.RexsAttributeId;
import info.rexs.schema.constants.RexsUnitId;
import info.rexs.schema.constants.RexsValueType;
import info.rexs.schema.constants.standard.RexsStandardAttributeIds;
import info.rexs.schema.constants.standard.RexsStandardUnitIds;
import lombok.Getter;

/**
* This class represents an attribute of a REXS model.
Expand All @@ -39,16 +40,28 @@
*/
public class RexsAttribute {

/** The ID of the attribute. */
/**
* The ID of the attribute as a {@link RexsAttributeId}.
*/
@Getter
private RexsAttributeId attributeId;

/** The origin ID of the attribute */
private String originAttributeId;
/**
* The origin ID of the attribute as a {@link String}.
*/
@Getter
private final String originAttributeId;

/** The unit of the attribute. */
/**
* The unit of the attribute as a {@link RexsUnitId}.
*/
@Getter
private RexsUnitId unit;

/** The orign unti of the attribute */
/**
* The origin unit of the attribute as a {@link String}.
*/
@Getter
private String originUnit;

/**The value of the attribute */
Expand Down Expand Up @@ -108,43 +121,11 @@ public RexsAttribute(RexsAttribute attribute) {
this.setRawValue(attribute.value.copy());
}

/**
* @return
* The ID of the attribute as a {@link RexsAttributeId}.
*/
public RexsAttributeId getAttributeId() {
return attributeId;
}

/**
* @return
* The origin ID of the attribute as a {@link String}.
*/
public String getOriginAttributeId() {
return originAttributeId;
}

/**
* @return
* The unit of the attribute as {@link RexsUnitId}.
*/
public RexsUnitId getUnit() {
return unit;
}

public void setUnit(RexsUnitId unit) {
this.unit = unit;
this.originUnit = unit.getId();
}

/**
* @return
* The origing unit of the attribute as a {@link String}.
*/
public String getOriginUnit() {
return originUnit;
}

/**
* @return
* The value of the attribute as a {@link AbstractRexsAttributeValue}.
Expand Down
55 changes: 18 additions & 37 deletions api/src/main/java/info/rexs/model/RexsComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import info.rexs.schema.constants.RexsComponentType;
import info.rexs.schema.constants.RexsUnitId;
import info.rexs.schema.constants.RexsValueType;
import lombok.Getter;
import lombok.Setter;

/**
* This class represents an component of a REXS model.
Expand All @@ -34,20 +36,31 @@
*/
public class RexsComponent implements Comparable<RexsComponent> {

/** The numeric ID of the component within the REXS model. */
/**
* The numeric ID of the component within the REXS model.
*/
@Getter
private Integer id;

/** The type of the component. */
/**
* The type of the component as a {@link RexsComponentType}.
*/
@Setter
@Getter
private RexsComponentType type;

/** The origin type of the component */
private String originType;
/**
* The origin type of the component as a {@link String}.
*/
@Getter
private final String originType;

/** The name of the component */
@Setter
private String name;

/** An internal index with all attributes of the component for quick access. */
private Map<String, RexsAttribute> attributes = new HashMap<>();
private final Map<String, RexsAttribute> attributes = new HashMap<>();

/**
* Constructs a new {@link RexsComponent} for the given properties.
Expand Down Expand Up @@ -95,30 +108,6 @@ public RexsComponent(RexsComponent component) {
}
}

/**
* @return
* The numeric ID of the component within the REXS model.
*/
public Integer getId() {
return id;
}

/**
* @return
* The type of the component as {@link RexsComponentType}.
*/
public RexsComponentType getType() {
return type;
}

/**
* @return
* The orign type of the component as a {@link String}.
*/
public String getOriginType() {
return originType;
}

/**
* @return
* The name of the component within the REXS model.
Expand All @@ -129,10 +118,6 @@ public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

/**
* @return
* All attributes assigned to the component as a {@link Collection} of {@link RexsAttribute}.
Expand Down Expand Up @@ -1045,10 +1030,6 @@ public void setId(Integer newCompId) {
this.id = newCompId;
}

public void setType(RexsComponentType newType) {
this.type = newType;
}

@Override
public boolean equals(Object o) {
if (o == this) {
Expand Down
Loading
Loading