JAMES-2529 Remove getter for AddressHeader

The code is only used by the MailMatcher class thus this boiler plate code is 
not required.


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/ee14044c
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/ee14044c
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/ee14044c

Branch: refs/heads/master
Commit: ee14044c842916b0f36e1d09b2199cb971a936ce
Parents: b62bc55
Author: Benoit Tellier <btell...@linagora.com>
Authored: Thu Aug 30 10:23:48 2018 +0700
Committer: Antoine Duprat <adup...@linagora.com>
Committed: Thu Aug 30 15:07:02 2018 +0200

----------------------------------------------------------------------
 .../james/jmap/mailet/filter/MailMatcher.java   | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ee14044c/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/filter/MailMatcher.java
----------------------------------------------------------------------
diff --git 
a/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/filter/MailMatcher.java
 
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/filter/MailMatcher.java
index 410146e..ab7e05d 100644
--- 
a/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/filter/MailMatcher.java
+++ 
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/filter/MailMatcher.java
@@ -107,18 +107,6 @@ public interface MailMatcher {
                     return Optional.empty();
                 }
             }
-
-            public Optional<String> getPersonal() {
-                return personal;
-            }
-
-            public Optional<String> getAddress() {
-                return address;
-            }
-
-            public String getFullAddress() {
-                return fullAddress;
-            }
         }
 
         ContentMatcher STRING_CONTAINS_MATCHER = (contents, valueToMatch) -> 
contents.anyMatch(content -> StringUtils.contains(content, valueToMatch));
@@ -128,14 +116,14 @@ public interface MailMatcher {
 
         ContentMatcher ADDRESS_CONTAINS_MATCHER = (contents, valueToMatch) -> 
contents
             .map(ContentMatcher::asAddressHeader)
-            .anyMatch(addressHeader -> 
StringUtils.containsIgnoreCase(addressHeader.getFullAddress(), valueToMatch));
+            .anyMatch(addressHeader -> 
StringUtils.containsIgnoreCase(addressHeader.fullAddress, valueToMatch));
         ContentMatcher ADDRESS_NOT_CONTAINS_MATCHER = 
negate(ADDRESS_CONTAINS_MATCHER);
         ContentMatcher ADDRESS_EXACTLY_EQUALS_MATCHER = (contents, 
valueToMatch) -> contents
             .map(ContentMatcher::asAddressHeader)
             .anyMatch(addressHeader ->
-                valueToMatch.equalsIgnoreCase(addressHeader.getFullAddress())
-                    || 
addressHeader.getAddress().map(valueToMatch::equalsIgnoreCase).orElse(false)
-                    || 
addressHeader.getPersonal().map(valueToMatch::equalsIgnoreCase).orElse(false));
+                valueToMatch.equalsIgnoreCase(addressHeader.fullAddress)
+                    || 
addressHeader.address.map(valueToMatch::equalsIgnoreCase).orElse(false)
+                    || 
addressHeader.personal.map(valueToMatch::equalsIgnoreCase).orElse(false));
         ContentMatcher ADDRESS_NOT_EXACTLY_EQUALS_MATCHER = 
negate(ADDRESS_EXACTLY_EQUALS_MATCHER);
 
         Map<Rule.Condition.Comparator, ContentMatcher> 
HEADER_ADDRESS_MATCHER_REGISTRY = ImmutableMap.<Rule.Condition.Comparator, 
ContentMatcher>builder()


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to