X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-tosca%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Ftosca%2Fauthorative%2Fconcepts%2FToscaEntityFilter.java;fp=models-tosca%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Ftosca%2Fauthorative%2Fconcepts%2FToscaPolicyTypeFilter.java;h=ef0b6b183fa20535a31c181ff624a6a010106d6a;hb=ed54f1f94a43e9fc5e353eb2c7111dcc552be18e;hp=4e9810b9842065dfe846bac4e236cb2c4f9713c1;hpb=23dec48efae039ff961ea68358ab69d80a81531b;p=policy%2Fmodels.git diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeFilter.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntityFilter.java similarity index 81% rename from models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeFilter.java rename to models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntityFilter.java index 4e9810b98..ef0b6b183 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeFilter.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntityFilter.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2020 Nordix Foundation. + * Copyright (C) 2019-2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,13 +28,13 @@ import lombok.NonNull; import org.onap.policy.models.base.PfObjectFilter; /** - * Filter class for searches for {@link ToscaPolicyType} instances. If any fields are null, they are ignored. + * Filter class for searches for {@link ToscaEntity} instances. If any fields are null, they are ignored. * * @author Liam Fallon (liam.fallon@est.tech) */ @Builder @Data -public class ToscaPolicyTypeFilter implements PfObjectFilter { +public class ToscaEntityFilter implements PfObjectFilter { public static final String LATEST_VERSION = "LATEST"; // Regular expression @@ -44,10 +44,10 @@ public class ToscaPolicyTypeFilter implements PfObjectFilter { private String version; @Override - public List filter(@NonNull final List originalList) { + public List filter(@NonNull final List originalList) { // @formatter:off - List returnList = originalList.stream() + List returnList = originalList.stream() .filter(p -> filterString(p.getName(), name)) .filter(p -> LATEST_VERSION.equals(version) || filterString(p.getVersion(), version)) @@ -55,7 +55,7 @@ public class ToscaPolicyTypeFilter implements PfObjectFilter { // @formatter:off if (LATEST_VERSION.equals(version)) { - return this.latestVersionFilter(returnList, new ToscaPolicyTypeComparator()); + return this.latestVersionFilter(returnList, new ToscaEntityComparator()); } else { return returnList; }