diff --git a/pom.xml b/pom.xml index 3880b96..3023726 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.umutayb Utilities - 1.6.8 + 1.6.8-SNAPSHOT jar Java-Utilities @@ -58,7 +58,6 @@ 1.8 4.8.0 2.9.0 - 1.18.26 4.9.3 17 @@ -140,14 +139,6 @@ ${retrofit.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - - org.apache.poi diff --git a/src/main/java/utils/email/EmailUtilities.java b/src/main/java/utils/email/EmailUtilities.java index 11ec4d2..d68f5e0 100644 --- a/src/main/java/utils/email/EmailUtilities.java +++ b/src/main/java/utils/email/EmailUtilities.java @@ -5,10 +5,6 @@ import jakarta.mail.internet.InternetAddress; import jakarta.mail.internet.MimeBodyPart; import jakarta.mail.internet.MimeMessage; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.Getter; -import lombok.NoArgsConstructor; import utils.DateUtilities; import utils.Printer; import utils.reflection.ReflectionUtilities; @@ -19,7 +15,7 @@ import static utils.arrays.lambda.Collectors.toSingleton; -@SuppressWarnings("unused") +@SuppressWarnings({"unused", "UnusedReturnValue"}) public class EmailUtilities { /** @@ -115,8 +111,11 @@ public static class Inbox { * List of email messages represented as a list of maps where each map contains email fields as keys * and their corresponding values as values. */ - @Getter - public List messages = new ArrayList<>(); + public static List messages = new ArrayList<>(); + + public List getMessages() { + return messages; + } /** * Enumeration of email fields used as keys in the map representation of email messages. @@ -126,11 +125,53 @@ public enum EmailField {SUBJECT, SENDER, CONTENT, @Deprecated(since = "1.6.2", f /** * This class represents an email message. */ - @Data - @AllArgsConstructor - @NoArgsConstructor public static class EmailMessage { String from; + + public String getSentDate() { + return sentDate; + } + + public void setSentDate(String sentDate) { + this.sentDate = sentDate; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public String getMessageContent() { + return messageContent; + } + + public void setMessageContent(String messageContent) { + this.messageContent = messageContent; + } + + public String getAttachments() { + return attachments; + } + + public void setAttachments(String attachments) { + this.attachments = attachments; + } + + public String getFileName() { + return fileName; + } + + public String getFrom() { + return from; + } + + public void setFrom(String from) { + this.from = from; + } + String sentDate; String subject; String messageContent; @@ -175,7 +216,7 @@ public void setFileName(String fileName){ * @return the email message matching the filter criteria */ public EmailMessage getMessageBy(List> filterPairs) { - return this.messages.stream() + return messages.stream() .filter(message -> emailMatch(message, filterPairs)) .collect(toSingleton()); } @@ -281,7 +322,7 @@ public static void load(Inbox inbox, int timeout, int expectedMessageCount, bool timeout, () -> { inbox.load(print, save, saveAttachments, filterPairs); - return inbox.messages.size() >= expectedMessageCount; + return messages.size() >= expectedMessageCount; } ); } @@ -342,7 +383,7 @@ public void load(boolean print, boolean save, boolean saveAttachments, List photoUrls, List photoUrls, List tags, String status) { + this.id = id; + this.category = category; + this.name = name; + this.photoUrls = photoUrls; + this.tags = tags; + this.status = status; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public DataModel getCategory() { + return category; + } + + public void setCategory(DataModel category) { + this.category = category; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + public static class DataModel { Long id; String name; + + public DataModel(Long id, String name) { + this.id = id; + this.name = name; + } + + public DataModel() { + } } }