X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Frepository%2FPolicyTypes.java;h=f686ee4c1f81ec4772715a49a8dfac25c7144cc0;hb=296f7c083ed15a57e59ea4546eb0624bf235d29b;hp=ef3f42d4ab743fcdc848b79680ccfb5c311e92b6;hpb=2aa1689637366d03a1252afadf93be937c1ec644;p=nonrtric.git diff --git a/policy-agent/src/main/java/org/oransc/policyagent/repository/PolicyTypes.java b/policy-agent/src/main/java/org/oransc/policyagent/repository/PolicyTypes.java index ef3f42d4..f686ee4c 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/repository/PolicyTypes.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/repository/PolicyTypes.java @@ -24,16 +24,10 @@ import java.util.HashMap; import java.util.Map; import org.oransc.policyagent.exceptions.ServiceException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; public class PolicyTypes { - private static final Logger logger = LoggerFactory.getLogger(PolicyTypes.class); - private Map types = new HashMap(); - @Autowired public PolicyTypes() { } @@ -45,8 +39,15 @@ public class PolicyTypes { return t; } - public synchronized void putType(String name, PolicyType type) { - types.put(name, type); + public synchronized void put(PolicyType type) { + types.put(type.name(), type); + } + + public boolean contains(PolicyType policyType) { + return types.containsKey(policyType.name()); } + public int size() { + return types.size(); + } }