Skip to content

Commit

Permalink
Utility i NareVersion. Fjerne en del deprecated (#207)
Browse files Browse the repository at this point in the history
* Utility i NareVersion. Fjerne en del deprecated

* Metodekall isf aksess
  • Loading branch information
jolarsen authored Jun 25, 2024
1 parent d62e6b3 commit 63b86a6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 57 deletions.
17 changes: 4 additions & 13 deletions src/main/java/no/nav/fpsak/nare/doc/RuleDescriptionDigraph.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package no.nav.fpsak.nare.doc;

import java.util.IdentityHashMap;
import java.util.LinkedHashSet;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import no.nav.fpsak.nare.evaluation.Operator;
import no.nav.fpsak.nare.json.JsonOutput;

import java.util.IdentityHashMap;
import java.util.LinkedHashSet;
import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
public class RuleDescriptionDigraph {

Expand Down Expand Up @@ -41,14 +40,6 @@ public RuleDescriptionDigraph(RuleDescription root, RuleNodeIdProducer idProduce
this.versions = versions;
}

//bruk istedet den andre constructoren
@Deprecated(forRemoval = true, since = "2.6.0")
public RuleDescriptionDigraph(RuleDescription root, RuleNodeIdProducer idProducer) {
this.idProducer = idProducer;
this.root = process(root);
this.versions = null;
}

private RuleNode process(RuleDescription ruledesc) {
Boolean prev = processed.putIfAbsent(ruledesc, true);
if (prev != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/no/nav/fpsak/nare/doc/RuleEdge.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
@JsonInclude(Include.NON_NULL)
public record RuleEdge(String source, String target, String role) {
public RuleEdge(RuleNode source, RuleNode target, String edgeRole) {
this(source.id, target.id, edgeRole);
this(source.id(), target.id(), edgeRole);
}
}
38 changes: 3 additions & 35 deletions src/main/java/no/nav/fpsak/nare/doc/RuleNode.java
Original file line number Diff line number Diff line change
@@ -1,48 +1,16 @@
package no.nav.fpsak.nare.doc;

import java.util.UUID;

import no.nav.fpsak.nare.evaluation.Operator;

@SuppressWarnings("unused")
public class RuleNode {
final String id;

private final String ruleId;
private final String ruleDescription;
private final Operator operator;
private RuleDescription rule;

@Deprecated(forRemoval = true, since = "2.6.0")
public RuleNode(String ruleId, String ruleDescription, Operator operator) {
this.id = UUID.randomUUID().toString();
this.ruleId = ruleId;
this.ruleDescription = ruleDescription;
this.operator = operator;
}

@Deprecated(forRemoval = true, since = "2.6.0")
public RuleNode(RuleDescription node) {
this.id = UUID.randomUUID().toString();
this.ruleId = node.getRuleIdentification();
this.ruleDescription = node.getRuleDescription();
this.operator = node.getOperator();
this.rule = node;
}
public record RuleNode(String id, String ruleId, String ruleDescription, Operator operator, RuleDescription rule) {

public RuleNode(String id, String ruleId, String ruleDescription, Operator operator) {
this.id = id;
this.ruleId = ruleId;
this.ruleDescription = ruleDescription;
this.operator = operator;
this(id, ruleId, ruleDescription, operator, null);
}

public RuleNode(String id, RuleDescription node) {
this.id = id;
this.ruleId = node.getRuleIdentification();
this.ruleDescription = node.getRuleDescription();
this.operator = node.getOperator();
this.rule = node;
this(id, node.getRuleIdentification(), node.getRuleDescription(), node.getOperator(), node);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ public record EvaluationVersion(String name, String version) {
Objects.requireNonNull(version, "version");
}

@Deprecated(forRemoval = true, since = "2.6.0")
public String getName() {
return name;
}

@Deprecated(forRemoval = true, since = "2.6.0")
public String getVersion() {
return version;
public String nameAndVersion() {
return name() + ':' + version();
}
}

0 comments on commit 63b86a6

Please sign in to comment.