X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-base%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Fbase%2FPfObjectFilter.java;h=342fbab737b057d17941d82c6e1f0e6eb41a001d;hb=b87e0242ce1a957740ee988bec3b82e3628adbed;hp=f7e29f1b44da61b48816ed8effc983fdbc59695f;hpb=12fce55a66848bcc7f71430324b3a9051b8ce0d4;p=policy%2Fmodels.git diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java b/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java index f7e29f1b4..342fbab73 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java @@ -56,8 +56,7 @@ public interface PfObjectFilter { } /** - * Gets a predicate used to filter an item in a list by exactly matching an extracted value - * with some text. + * Gets a predicate used to filter an item in a list by exactly matching an extracted value with some text. * * @param text the desired text to check against, or {@code null} if to accept everything * @param extractor function to extract the value, to be matched, from a list item @@ -73,11 +72,9 @@ public interface PfObjectFilter { } /** - * Gets a predicate used to filter an item in a list by comparing the start of an - * extracted value with a prefix. + * Gets a predicate used to filter an item in a list by comparing the start of an extracted value with a prefix. * - * @param prefix the desired prefix to check against, or {@code null} if to accept - * everything + * @param prefix the desired prefix to check against, or {@code null} if to accept everything * @param extractor function to extract the value, to be matched, from a list item * @return a predicate to match a prefix with a value from a list item */ @@ -94,8 +91,7 @@ public interface PfObjectFilter { } /** - * Gets a predicate used to filter an item in a list by matching an extracted value - * with a regular expression. + * Gets a predicate used to filter an item in a list by matching an extracted value with a regular expression. * * @param pattern regular expression to match, or {@code null} if to accept everything * @param extractor function to extract the value, to be matched, from a list item @@ -140,7 +136,8 @@ public interface PfObjectFilter { * The list is sorted so if the last element name is the same as the current element name, the current * element should be removed. */ - if (!((PfNameVersion) curElement).getName().equals(((PfNameVersion) lastElement).getName())) { + if (PfUtils.compareObjects(((PfNameVersion) curElement).getName(), + ((PfNameVersion) lastElement).getName()) != 0) { // have a new name - done comparing with the old "current" ++icur; }