Permalink
Browse files

Fixed the use of generic collection parameters in Message and related…

… classes

git-svn-id: https://svn.apache.org/repos/asf/james/mime4j/trunk@1225507 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 7562f0d commit 649c21e783e102a90fa9bc201cee32c1ac7ac5a5 @ok2c ok2c committed Dec 29, 2011
@@ -199,7 +199,7 @@
* addresses to set or <code>null</code> or an empty collection
* to remove the header field.
*/
- void setTo(Collection<Address> to);
+ void setTo(Collection<? extends Address> to);
/**
* Returns the value of the <i>Cc</i> header field of this message as
@@ -238,7 +238,7 @@
* addresses to set or <code>null</code> or an empty collection
* to remove the header field.
*/
- void setCc(Collection<Address> cc);
+ void setCc(Collection<? extends Address> cc);
/**
* Returns the value of the <i>Bcc</i> header field of this message as
@@ -277,7 +277,7 @@
* addresses to set or <code>null</code> or an empty collection
* to remove the header field.
*/
- void setBcc(Collection<Address> bcc);
+ void setBcc(Collection<? extends Address> bcc);
/**
* Returns the value of the <i>Reply-To</i> header field of this message as
@@ -316,6 +316,6 @@
* addresses to set or <code>null</code> or an empty collection
* to remove the header field.
*/
- void setReplyTo(Collection<Address> replyTo);
+ void setReplyTo(Collection<? extends Address> replyTo);
}
@@ -561,7 +561,7 @@ public static MailboxListField mailboxList(String fieldName,
* @return the newly created address-list field.
*/
public static AddressListField addressList(String fieldName,
- Iterable<Address> addresses) {
+ Iterable<? extends Address> addresses) {
checkValidFieldName(fieldName);
return addressList0(fieldName, addresses);
}
@@ -584,7 +584,7 @@ private static MailboxListField mailboxList0(String fieldName,
}
private static AddressListField addressList0(String fieldName,
- Iterable<Address> addresses) {
+ Iterable<? extends Address> addresses) {
String fieldValue = encodeAddresses(addresses);
return parse(AddressListFieldImpl.PARSER, fieldName, fieldValue);
}
@@ -271,7 +271,7 @@ public void setTo(Address... to) {
* addresses to set or <code>null</code> or an empty collection
* to remove the header field.
*/
- public void setTo(Collection<Address> to) {
+ public void setTo(Collection<? extends Address> to) {
setAddressList(FieldName.TO, to);
}
@@ -318,7 +318,7 @@ public void setCc(Address... cc) {
* addresses to set or <code>null</code> or an empty collection
* to remove the header field.
*/
- public void setCc(Collection<Address> cc) {
+ public void setCc(Collection<? extends Address> cc) {
setAddressList(FieldName.CC, cc);
}
@@ -365,7 +365,7 @@ public void setBcc(Address... bcc) {
* addresses to set or <code>null</code> or an empty collection
* to remove the header field.
*/
- public void setBcc(Collection<Address> bcc) {
+ public void setBcc(Collection<? extends Address> bcc) {
setAddressList(FieldName.BCC, bcc);
}
@@ -412,7 +412,7 @@ public void setReplyTo(Address... replyTo) {
* addresses to set or <code>null</code> or an empty collection
* to remove the header field.
*/
- public void setReplyTo(Collection<Address> replyTo) {
+ public void setReplyTo(Collection<? extends Address> replyTo) {
setAddressList(FieldName.REPLY_TO, replyTo);
}
@@ -480,7 +480,7 @@ private void setAddressList(String fieldName, Address... addresses) {
.asList(addresses));
}
- private void setAddressList(String fieldName, Collection<Address> addresses) {
+ private void setAddressList(String fieldName, Collection<? extends Address> addresses) {
Header header = obtainHeader();
if (addresses == null || addresses.isEmpty()) {
@@ -490,7 +490,7 @@ private void setAddressList(String fieldName, Collection<Address> addresses) {
}
}
- protected abstract AddressListField newAddressList(String fieldName, Collection<Address> addresses);
+ protected abstract AddressListField newAddressList(String fieldName, Collection<? extends Address> addresses);
protected abstract UnstructuredField newSubject(String subject);
@@ -88,7 +88,7 @@ protected MailboxListField newMailboxList(String fieldName,
@Override
protected AddressListField newAddressList(String fieldName,
- Collection<Address> addresses) {
+ Collection<? extends Address> addresses) {
return Fields.addressList(fieldName, addresses);
}

0 comments on commit 649c21e

Please sign in to comment.