You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ad...@apache.org on 2018/08/30 13:15:52 UTC

[10/26] james-project git commit: JAMES-2529 Remove getter for AddressHeader

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 <bt...@linagora.com>
Authored: Thu Aug 30 10:23:48 2018 +0700
Committer: Antoine Duprat <ad...@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-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org