You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2023/04/13 04:35:09 UTC

[james-project] 05/05: JAMES-3899 JavaDoc for StorageDirective

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit c773dccb070326ce6dee3a9ae89b5307acb1f727
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Apr 7 14:13:09 2023 +0700

    JAMES-3899 JavaDoc for StorageDirective
---
 .../java/org/apache/mailet/StorageDirective.java    | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/mailet/api/src/main/java/org/apache/mailet/StorageDirective.java b/mailet/api/src/main/java/org/apache/mailet/StorageDirective.java
index f931d041fe..a55f46764e 100644
--- a/mailet/api/src/main/java/org/apache/mailet/StorageDirective.java
+++ b/mailet/api/src/main/java/org/apache/mailet/StorageDirective.java
@@ -30,6 +30,27 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.primitives.Booleans;
 
+/**
+ * StorageDirective allows mailets to set storage instructions applied by mailet container.
+ *
+ * Usage:
+ *
+ * <pre>
+ *     <code>
+ *         StorageDirective.builder()
+ *             .targetFolder("target")
+ *             .seen(true)
+ *             .important(true)
+ *             .keywords(ImmutableList.of("abc", "def")
+ *             .build()
+ *             .encodeAsAttributes(Username.of("bob@localhost")
+ *             .forEach(mail::setAttribute);
+ *      </code></code>
+ * </pre>
+ *
+ * This will result in this mail to be placed for bob@localhost into the folder target,
+ * with user flags abc, def and marked as Flagged and Seen.
+ */
 public class StorageDirective {
     public static class Builder {
         private Optional<String> targetFolder = Optional.empty();


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org