diff options
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOMessage.java')
| -rw-r--r-- | projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOMessage.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOMessage.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOMessage.java index f2310c2..d051a53 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOMessage.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOMessage.java @@ -33,9 +33,9 @@ import net.wotonomy.foundation.NSMutableDictionary; public class WOMessage { protected String _contentEncoding = "ISO8859_1"; - protected NSMutableDictionary _headers = new NSMutableDictionary(); - protected NSMutableDictionary _cookies = new NSMutableDictionary(); - private NSMutableDictionary _userInfo = new NSMutableDictionary(); + protected NSMutableDictionary<String, NSArray<String>> _headers = new NSMutableDictionary<>(); + protected NSMutableDictionary<String, WOCookie> _cookies = new NSMutableDictionary<>(); + private NSMutableDictionary<Object, Object> _userInfo = new NSMutableDictionary<>(); protected NSMutableData _contentData = new NSMutableData(); public WOMessage() { @@ -59,7 +59,7 @@ public class WOMessage { /** * Sets the specified array of values as headers under the specified key. */ - public void setHeaders(NSArray headerArray, String aKey) { + public void setHeaders(NSArray<String> headerArray, String aKey) { _headers.setObjectForKey(headerArray, aKey); } @@ -67,13 +67,13 @@ public class WOMessage { * Sets the specified header value for the specified key. */ public void setHeader(String aValue, String aKey) { - _headers.setObjectForKey(new NSArray(aValue), aKey); + _headers.setObjectForKey(new NSArray<>(aValue), aKey); } /** * Returns an array of all the header keys that have been set in the response. */ - public NSArray headerKeys() { + public NSArray<String> headerKeys() { return _headers.allKeys(); } @@ -81,8 +81,8 @@ public class WOMessage { * Returns an array of all the header values for the specified key, or null if * the key does not exist. */ - public NSArray headersForKey(String aKey) { - return (NSArray) _headers.objectForKey(aKey); + public NSArray<String> headersForKey(String aKey) { + return _headers.objectForKey(aKey); } /** @@ -90,7 +90,7 @@ public class WOMessage { * since most header keys will have a single value. */ public String headerForKey(String aKey) { - NSArray values = (NSArray) _headers.objectForKey(aKey); + NSArray<String> values = _headers.objectForKey(aKey); if (values != null && values.count() > 0) { return values.objectAtIndex(0).toString(); } @@ -118,8 +118,8 @@ public class WOMessage { * application-specific uses and are available to other actions and components * in the request-response cycle. */ - public void setUserInfo(NSDictionary aDict) { - _userInfo = new NSMutableDictionary(aDict); + public void setUserInfo(NSDictionary<Object, Object> aDict) { + _userInfo = new NSMutableDictionary<>(aDict); } /** @@ -127,8 +127,8 @@ public class WOMessage { * application-specific uses are are available to other actions and components * in the request-response cycle. */ - public NSDictionary userInfo() { - return new NSDictionary(_userInfo); + public NSDictionary<Object, Object> userInfo() { + return new NSDictionary<>(_userInfo); } /** @@ -195,7 +195,7 @@ public class WOMessage { * Returns an array of cookies currently being sent with the response. Contains * whatever cookies have previously been set in this response. */ - public NSArray cookies() { + public NSArray<WOCookie> cookies() { return _cookies.allValues(); } |
