summaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/java/org/onap
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2017-09-22 13:30:49 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-22 13:30:49 +0000
commit240201929cdf1df02512fdad12b37347f3f0b73c (patch)
treec95e659149ad7602ed0c68fd54f7bc08c703ce01 /policy-management/src/main/java/org/onap
parent085dd9b5c211edaf70533105de1a460bcfae0a14 (diff)
parent5a8fe222ebc4485fae7e78be8e9926d6e51ac93a (diff)
Merge "Added @Override method"
Diffstat (limited to 'policy-management/src/main/java/org/onap')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/protocol/coders/EventProtocolCoder.java30
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/protocol/coders/JsonProtocolFilter.java4
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java5
3 files changed, 20 insertions, 19 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/EventProtocolCoder.java b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/EventProtocolCoder.java
index 762f4476..6f14076f 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/EventProtocolCoder.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/EventProtocolCoder.java
@@ -670,13 +670,13 @@ abstract class GenericEventProtocolCoder {
* and consequently the second value will be the less likely.
*/
protected final HashMap<String, Pair<ProtocolCoderToolset,ProtocolCoderToolset>> coders =
- new HashMap<String, Pair<ProtocolCoderToolset,ProtocolCoderToolset>>();
+ new HashMap<>();
/**
* Mapping topic + classname -> Protocol Set
*/
protected final HashMap<String, List<Pair<ProtocolCoderToolset,ProtocolCoderToolset>>> reverseCoders =
- new HashMap<String, List<Pair<ProtocolCoderToolset,ProtocolCoderToolset>>>();
+ new HashMap<>();
protected boolean multipleToolsetRetries = false;
@@ -735,7 +735,7 @@ abstract class GenericEventProtocolCoder {
this, reverseKey, key, toolsets.first());
List<Pair<ProtocolCoderToolset,ProtocolCoderToolset>> reverseMappings =
- new ArrayList<Pair<ProtocolCoderToolset,ProtocolCoderToolset>>();
+ new ArrayList<>();
reverseMappings.add(toolsets);
reverseCoders.put(reverseKey, reverseMappings);
}
@@ -767,7 +767,7 @@ abstract class GenericEventProtocolCoder {
// are detected in the gson encoding
Pair<ProtocolCoderToolset,ProtocolCoderToolset> coderTools =
- new Pair<ProtocolCoderToolset,ProtocolCoderToolset>(gsonCoderTools,
+ new Pair<>(gsonCoderTools,
jacksonCoderTools);
logger.info("{}: adding coders for new {}: {}", this, key, coderTools.first());
@@ -800,7 +800,7 @@ abstract class GenericEventProtocolCoder {
}
} else {
List<Pair<ProtocolCoderToolset,ProtocolCoderToolset>> toolsets =
- new ArrayList<Pair<ProtocolCoderToolset,ProtocolCoderToolset>>();
+ new ArrayList<>();
toolsets.add(coderTools);
logger.info("{}: adding toolset for reverse key {}: {}", this, reverseKey, toolsets);
@@ -909,7 +909,7 @@ abstract class GenericEventProtocolCoder {
String key = this.codersKey(groupId, artifactId, topic);
synchronized(this) {
- return (coders.containsKey(key));
+ return coders.containsKey(key);
}
}
@@ -1102,7 +1102,7 @@ abstract class GenericEventProtocolCoder {
protected List<DroolsController> droolsCreators(String topic, Object encodedClass)
throws IllegalStateException, IllegalArgumentException {
- List<DroolsController> droolsControllers = new ArrayList<DroolsController>();
+ List<DroolsController> droolsControllers = new ArrayList<>();
String reverseKey = this.reverseCodersKey(topic, encodedClass.getClass().getCanonicalName());
if (!this.reverseCoders.containsKey(reverseKey)) {
@@ -1127,8 +1127,8 @@ abstract class GenericEventProtocolCoder {
// figure out the right toolset
String groupId = encoderSet.first().getGroupId();
String artifactId = encoderSet.first().getArtifactId();
- List<CoderFilters> coders = encoderSet.first().getCoders();
- for (CoderFilters coder : coders) {
+ List<CoderFilters> coderFilters = encoderSet.first().getCoders();
+ for (CoderFilters coder : coderFilters) {
if (coder.getCodedClass().equals(encodedClass.getClass().getCanonicalName())) {
DroolsController droolsController =
DroolsController.factory.get(groupId, artifactId, "");
@@ -1206,7 +1206,7 @@ abstract class GenericEventProtocolCoder {
String key = this.codersKey(groupId, artifactId, "");
- List<CoderFilters> codersFilters = new ArrayList<CoderFilters>();
+ List<CoderFilters> codersFilters = new ArrayList<>();
for (Map.Entry<String, Pair<ProtocolCoderToolset,ProtocolCoderToolset>> entry : coders.entrySet()) {
if (entry.getKey().startsWith(key)) {
codersFilters.addAll(entry.getValue().first().getCoders());
@@ -1235,7 +1235,7 @@ abstract class GenericEventProtocolCoder {
String key = this.codersKey(groupId, artifactId, "");
- List<Pair<ProtocolCoderToolset,ProtocolCoderToolset>> coderToolset = new ArrayList<Pair<ProtocolCoderToolset,ProtocolCoderToolset>>();
+ List<Pair<ProtocolCoderToolset,ProtocolCoderToolset>> coderToolset = new ArrayList<>();
for (Map.Entry<String, Pair<ProtocolCoderToolset,ProtocolCoderToolset>> entry : coders.entrySet()) {
if (entry.getKey().startsWith(key)) {
coderToolset.add(entry.getValue());
@@ -1293,12 +1293,12 @@ abstract class GenericEventProtocolCoder {
throw new IllegalArgumentException("No Coder found for " + key);
- List<CoderFilters> coders = new ArrayList<CoderFilters>();
+ List<CoderFilters> coderFilters = new ArrayList<>();
for (Pair<ProtocolCoderToolset,ProtocolCoderToolset> toolset: toolsets) {
- coders.addAll(toolset.first().getCoders());
+ coderFilters.addAll(toolset.first().getCoders());
}
- return coders;
+ return coderFilters;
}
/**
@@ -1390,4 +1390,4 @@ class EventProtocolEncoder extends GenericEventProtocolCoder {
builder.append("EventProtocolEncoder [toString()=").append(super.toString()).append("]");
return builder.toString();
}
-} \ No newline at end of file
+}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/JsonProtocolFilter.java b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/JsonProtocolFilter.java
index 6afeb26a..0a52d254 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/JsonProtocolFilter.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/JsonProtocolFilter.java
@@ -119,7 +119,7 @@ public class JsonProtocolFilter {
/**
* all the filters to be applied
*/
- protected List<FilterRule> rules = new ArrayList<FilterRule>();
+ protected List<FilterRule> rules = new ArrayList<>();
/**
*
@@ -134,7 +134,7 @@ public class JsonProtocolFilter {
throw new IllegalArgumentException("No raw filters provided");
}
- List<FilterRule> filters = new ArrayList<FilterRule>();
+ List<FilterRule> filters = new ArrayList<>();
for (Pair<String, String> filterPair: rawFilters) {
if (filterPair.first() == null || filterPair.first().isEmpty()) {
continue;
diff --git a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java
index 1c8dafea..df51473d 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolset.java
@@ -87,7 +87,7 @@ public abstract class ProtocolCoderToolset {
/**
* Protocols and associated Filters
*/
- protected final List<CoderFilters> coders = new ArrayList<CoderFilters>();
+ protected final List<CoderFilters> coders = new ArrayList<>();
/**
* Tree model (instead of class model) generic parsing to be able to inspect elements
@@ -488,7 +488,7 @@ class GsonProtocolCoderToolset extends ProtocolCoderToolset {
* Adapter for ZonedDateTime
*/
public static class GsonUTCAdapter implements JsonSerializer<ZonedDateTime>, JsonDeserializer<ZonedDateTime> {
-
+ @Override
public ZonedDateTime deserialize(JsonElement element, Type type, JsonDeserializationContext context)
throws JsonParseException {
try {
@@ -500,6 +500,7 @@ class GsonProtocolCoderToolset extends ProtocolCoderToolset {
return null;
}
+ @Override
public JsonElement serialize(ZonedDateTime datetime, Type type, JsonSerializationContext context) {
return new JsonPrimitive(datetime.format(format));
}