X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ECOMP-ControlloopPolicy%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fcontrolloop%2Fpolicy%2Fguard%2FGuardPolicy.java;h=a4d56ff073ddbf95a91d02193540e8ca15d2c97b;hb=fc5c07705edc4dcb7083b39116a43844bb6a1490;hp=0195fac17217b7e2c38fd41f09f218c13890d442;hpb=dda032f8bb161d54eb1f59de2b4a3efb774fc4d1;p=policy%2Fengine.git diff --git a/ECOMP-ControlloopPolicy/src/main/java/org/openecomp/policy/controlloop/policy/guard/GuardPolicy.java b/ECOMP-ControlloopPolicy/src/main/java/org/openecomp/policy/controlloop/policy/guard/GuardPolicy.java index 0195fac17..a4d56ff07 100644 --- a/ECOMP-ControlloopPolicy/src/main/java/org/openecomp/policy/controlloop/policy/guard/GuardPolicy.java +++ b/ECOMP-ControlloopPolicy/src/main/java/org/openecomp/policy/controlloop/policy/guard/GuardPolicy.java @@ -26,17 +26,65 @@ import java.util.UUID; public class GuardPolicy { - public String id = UUID.randomUUID().toString(); - public String name; - public String description; - public String actor; - public String recipe; - public LinkedList limit_constraints; + private String id = UUID.randomUUID().toString(); + private String name; + private String description; + private String actor; + private String recipe; + private LinkedList limit_constraints; public GuardPolicy() { - + //Do Nothing Empty Constructor. } + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getActor() { + return actor; + } + + public void setActor(String actor) { + this.actor = actor; + } + + public String getRecipe() { + return recipe; + } + + public void setRecipe(String recipe) { + this.recipe = recipe; + } + + public LinkedList getLimit_constraints() { + return limit_constraints; + } + + public void setLimit_constraints(LinkedList limit_constraints) { + this.limit_constraints = limit_constraints; + } + public GuardPolicy(String id) { this.id = id; } @@ -82,20 +130,7 @@ public class GuardPolicy { } public boolean isValid() { - try { - if (id == null) { - throw new NullPointerException(); - } - if (name == null) { - throw new NullPointerException(); - } - if (actor == null) { - throw new NullPointerException(); - } - if (recipe == null) { - throw new NullPointerException(); - } - } catch (Exception e) { + if(id==null || name ==null|| actor==null|| recipe==null){ return false; } return true; @@ -104,7 +139,7 @@ public class GuardPolicy { @Override public String toString() { return "Policy [id=" + id + ", name=" + name + ", description=" + description + ", actor=" + actor + ", recipe=" - + recipe + ", limit_constraints=" + limit_constraints + "]"; + + recipe + ", limitConstraints=" + limit_constraints + "]"; } @Override