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=0d66e7de0d9e43f184d8dda78d79e2928de10512;hb=9d0abfec77a4a040a3e5c86fe4f5a24a4847ebb9;hp=dc299b62c17486441ff70b45a93369507d23ab75;hpb=4a7dd457d5b179dd0f588663fc1476dacfca4f22;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 dc299b62..0d66e7de 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 @@ -20,16 +20,13 @@ package org.oransc.policyagent.repository; +import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.oransc.policyagent.exceptions.ServiceException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class PolicyTypes { - private static final Logger logger = LoggerFactory.getLogger(PolicyTypes.class); - private Map types = new HashMap(); public PolicyTypes() { @@ -47,4 +44,19 @@ public class PolicyTypes { types.put(type.name(), type); } + public boolean contains(String policyType) { + return types.containsKey(policyType); + } + + public synchronized Collection getAll() { + return types.values(); + } + + public int size() { + return types.size(); + } + + public void clear() { + this.types.clear(); + } }