From 02bc52037e9ccccca672d6156d9c325c74fe28b3 Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Mon, 1 Jul 2024 17:27:48 -0400 Subject: Update a whole bunch of things Yeah... not a great commit message. t.b.h, I could maybe've split the commit into more parts; but that would be quite a lot off effort and would have a pretty decent chance of at least one of the commits leaving the repository in a non-working state. For the future, will want to try and commit more often so there aren't these mega-commits where it's just "a whole bunch of stuff changed" --- .../src/main/java/net/wotonomy/web/WOMessage.java | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOMessage.java') 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> _headers = new NSMutableDictionary<>(); + protected NSMutableDictionary _cookies = new NSMutableDictionary<>(); + private NSMutableDictionary _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 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 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 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 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 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 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 cookies() { return _cookies.allValues(); } -- cgit v1.2.3