Skip to content

Commit 170a4e3

Browse files
committed
Use static methods in Request HttpOperation
Currently org.ocpsoft.rewrite.servlet.config.Request is abstract and contains only instance methods. If you want to use this class, you will have to create an (anonymous) instance to invoke its methods. This commit changes the methods within Request to be static.
1 parent f68857d commit 170a4e3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • config-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config

‎config-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config/Request.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public abstract class Request extends HttpOperation
3737
*
3838
* @param encoding The encoding to apply
3939
*/
40-
public Request setCharacterEncoding(final String encoding)
40+
public static Request setCharacterEncoding(final String encoding)
4141
{
4242
return new Request() {
4343
@Override
@@ -63,9 +63,9 @@ public String toString()
6363
* Creates an {@link HttpOperation} that calls {@link HttpServletRequest#setCharacterEncoding(String)} on the current
6464
* request.
6565
*
66-
* @param encoding The character set to apply
66+
* @param charset The character set to apply
6767
*/
68-
public Request setCharacterEncoding(final Charset charset)
68+
public static Request setCharacterEncoding(final Charset charset)
6969
{
7070
return setCharacterEncoding(charset.name());
7171
}
@@ -77,7 +77,7 @@ public Request setCharacterEncoding(final Charset charset)
7777
* @param name The name of the request attribute
7878
* @param value The value to set
7979
*/
80-
public Request setAttribute(final String name, final Object value)
80+
public static Request setAttribute(final String name, final Object value)
8181
{
8282
return new Request() {
8383
@Override

0 commit comments

Comments
 (0)