Skip to content

Commit

Permalink
#6: Remove deprecated model "FragilityCurveRefactored" and remove req…
Browse files Browse the repository at this point in the history
…uirement to add className to FragilityCurve definition
  • Loading branch information
gowthamnvv committed Dec 1, 2021
1 parent ed86fed commit b71abf7
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 176 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ public FragilitySet uploadFragilitySet(@ApiParam(value = "json representing the

UserInfoUtils.throwExceptionIfIdPresent(fragilitySet.getId());
fragilitySet.setCreator(username);

if (fragilitySet.getFragilityCurves().size() == 0){
throw new IncoreHTTPException(Response.Status.BAD_REQUEST, "No fragility curves are included in the json. " +
"Please provide at least one.");
}
String fragilityId = this.fragilityDAO.saveFragility(fragilitySet);

Space space = spaceRepository.getSpaceByName(username);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,50 @@

package edu.illinois.ncsa.incore.service.dfr3.models;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import dev.morphia.annotations.Embedded;
import java.util.List;

import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;

@XmlTransient
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className")
@XmlSeeAlso({FragilityCurveRefactored.class})
@Embedded
public abstract class FragilityCurve {
public class FragilityCurve {
public String description;
public List<Rule> rules;
public ReturnType returnType;
public List<FragilityCurveParameter> fragilityCurveParameters;

public FragilityCurve() {

}

public FragilityCurve(String label) {
this.description = label;
public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public List<Rule> getRules() {
return rules;
}

public void setRules(List<Rule> rules) {
this.rules = rules;
}

public ReturnType getReturnType() {
return returnType;
}

public void setReturnType(ReturnType returnType) {
this.returnType = returnType;
}

public List<FragilityCurveParameter> getFragilityCurveParameters() {
return fragilityCurveParameters;
}

public void setFragilityCurveParameters(List<FragilityCurveParameter> fragilityCurveParameters) {
this.fragilityCurveParameters = fragilityCurveParameters;
}

}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@XmlTransient
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className")
@XmlSeeAlso({CustomExpressionRepairCurve.class, StandardRepairCurve.class, MarkovChainRepairCurve.class})
@XmlSeeAlso({StandardRepairCurve.class})
@Embedded
public abstract class RepairCurve {
public String description;
Expand Down

This file was deleted.

0 comments on commit b71abf7

Please sign in to comment.