Skip to content
Snippets Groups Projects
Commit 20079f92 authored by Nicola Fulvio Calabria's avatar Nicola Fulvio Calabria
Browse files

Minor refactoring

parent 7018dd6b
No related branches found
No related tags found
No related merge requests found
Pipeline #6695 failed
...@@ -5,18 +5,24 @@ ...@@ -5,18 +5,24 @@
*/ */
package it.inaf.oats.vospace.parent.exchange; package it.inaf.oats.vospace.parent.exchange;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.beans.Transient;
public class ArchiveEntryDescriptor { public class ArchiveEntryDescriptor {
private final String vosPath; private final String vosPath;
private final String targetNodeVosPath; private final String targetNodeVosPath;
public ArchiveEntryDescriptor(String vosPath, String targetNodeVosPath) { @JsonCreator
public ArchiveEntryDescriptor(@JsonProperty("vosPath")String vosPath,
@JsonProperty("targetNodeVosPath") String targetNodeVosPath) {
this.vosPath = vosPath; this.vosPath = vosPath;
this.targetNodeVosPath = targetNodeVosPath; this.targetNodeVosPath = targetNodeVosPath;
} }
public ArchiveEntryDescriptor(String vosPath) { public ArchiveEntryDescriptor(String vosPath) {
this(vosPath, null); this(vosPath, vosPath);
} }
public String getVosPath() { public String getVosPath() {
...@@ -24,16 +30,12 @@ public class ArchiveEntryDescriptor { ...@@ -24,16 +30,12 @@ public class ArchiveEntryDescriptor {
} }
public String getTargetNodeVosPath() { public String getTargetNodeVosPath() {
if (targetNodeVosPath == null) {
return vosPath;
} else {
return targetNodeVosPath; return targetNodeVosPath;
} }
}
@Transient
public boolean isPointingToAnotherNode() { public boolean isPointingToAnotherNode() {
return (targetNodeVosPath != null && return !targetNodeVosPath.equals(vosPath);
!targetNodeVosPath.equals(vosPath));
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment