Skip to content

Commit

Permalink
Add missing javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed May 1, 2023
1 parent 6a5c36b commit ad22fb3
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 3 deletions.
6 changes: 6 additions & 0 deletions api/src/main/java/jakarta/mail/Provider.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ public class Provider {
*/

public static class Type {
/**
* The Provider of type {@code STORE}.
*/
public static final Type STORE = new Type("STORE");
/**
* The Provider of type {@code TRANSPORT}.
*/
public static final Type TRANSPORT = new Type("TRANSPORT");

private String type;
Expand Down
10 changes: 10 additions & 0 deletions api/src/main/java/jakarta/mail/SendFailedException.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@
*/

public class SendFailedException extends MessagingException {

/**
* The invalid addresses.
*/
transient protected Address[] invalid;
/**
* Valid addresses to which message was sent.
*/
transient protected Address[] validSent;
/**
* Valid addresses to which message was not sent.
*/
transient protected Address[] validUnsent;

private static final long serialVersionUID = -6457531621682372913L;
Expand Down
5 changes: 5 additions & 0 deletions api/src/main/java/jakarta/mail/UIDFolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public interface UIDFolder {
* @see FetchProfile
*/
class FetchProfileItem extends FetchProfile.Item {
/**
* Constructor for an item.
*
* @param name the item name
*/
protected FetchProfileItem(String name) {
super(name);
}
Expand Down
5 changes: 4 additions & 1 deletion api/src/main/java/jakarta/mail/internet/InternetAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@

public class InternetAddress extends Address implements Cloneable {

protected String address; // email address
/**
* The email address.
*/
protected String address;

/**
* The personal name.
Expand Down
5 changes: 5 additions & 0 deletions api/src/main/java/jakarta/mail/internet/MimeMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,11 @@ public static class RecipientType extends Message.RecipientType {
public static final RecipientType NEWSGROUPS =
new RecipientType("Newsgroups");

/**
* Constructor for use by subclasses.
*
* @param type the recipient type
*/
protected RecipientType(String type) {
super(type);
}
Expand Down
9 changes: 8 additions & 1 deletion api/src/main/java/jakarta/mail/internet/NewsAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@

public class NewsAddress extends Address {

/**
* The newsgroup.
*/
protected String newsgroup;
protected String host; // may be null

/**
* The host. May be {@code null}.
*/
protected String host;

private static final long serialVersionUID = -4203797299824684143L;

Expand Down
5 changes: 5 additions & 0 deletions api/src/main/java/jakarta/mail/search/AddressTerm.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public abstract class AddressTerm extends SearchTerm {

private static final long serialVersionUID = 2005405551929769980L;

/**
* Constructor.
*
* @param address the address to match with.
*/
protected AddressTerm(Address address) {
this.address = address;
}
Expand Down
18 changes: 18 additions & 0 deletions api/src/main/java/jakarta/mail/search/ComparisonTerm.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,29 @@
public abstract class ComparisonTerm extends SearchTerm {
private static final long serialVersionUID = 1456646953666474308L;

/**
* Less than or equal to, "{@code <=}", comparison.
*/
public static final int LE = 1;
/**
* Less than, "{@code <}", comparison.
*/
public static final int LT = 2;
/**
* Equal to, "{@code =}", comparison.
*/
public static final int EQ = 3;
/**
* Not equal to, "{@code !=}", comparison.
*/
public static final int NE = 4;
/**
* Greater than, "{@code >}", comparison.
*/
public static final int GT = 5;
/**
* Greater than or equal to, "{@code >=}", comparison.
*/
public static final int GE = 6;

/**
Expand Down
12 changes: 12 additions & 0 deletions api/src/main/java/jakarta/mail/search/IntegerComparisonTerm.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public abstract class IntegerComparisonTerm extends ComparisonTerm {

private static final long serialVersionUID = -6963571240154302484L;

/**
* Constructor.
*
* @param comparison the type of comparison.
* @param number the number to compare with.
*/
protected IntegerComparisonTerm(int comparison, int number) {
this.comparison = comparison;
this.number = number;
Expand All @@ -55,6 +61,12 @@ public int getComparison() {
return comparison;
}

/**
* Match against the argument {@code i}.
*
* @param i the integer to match
* @return true if given integer matches this comparison; otherwise false
*/
protected boolean match(int i) {
switch (comparison) {
case LE:
Expand Down
5 changes: 5 additions & 0 deletions api/src/main/java/jakarta/mail/search/NotTerm.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public final class NotTerm extends SearchTerm {

private static final long serialVersionUID = 7152293214217310216L;

/**
* Constructor.
*
* @param t the term to negate.
*/
public NotTerm(SearchTerm t) {
term = t;
}
Expand Down
6 changes: 6 additions & 0 deletions api/src/main/java/jakarta/mail/search/StringTerm.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public boolean getIgnoreCase() {
return ignoreCase;
}

/**
* The match method.
*
* @param s The pattern search is applied on given String
* @return true if given string matches this pattern; otherwise false
*/
protected boolean match(String s) {
int len = s.length() - pattern.length();
for (int i = 0; i <= len; i++) {
Expand Down
5 changes: 4 additions & 1 deletion api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -14,6 +14,9 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

/**
* Jakarta Mail API
*/
module jakarta.mail {

requires java.logging;
Expand Down

0 comments on commit ad22fb3

Please sign in to comment.