diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-11-18 20:37:35 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-11-18 20:37:35 +0100 |
commit | b01ecd72d26a45ff4b498881446f5e62237c64be (patch) | |
tree | c6b4626e262d234900929132e4554b00cda03c49 /container-core/src/main/java/com/yahoo/container/handler/test/MockServiceHandler.java | |
parent | 804b5ea7d3822847d2b732c79fd35a5eceba15b4 (diff) |
Non-functional-changes-only
Diffstat (limited to 'container-core/src/main/java/com/yahoo/container/handler/test/MockServiceHandler.java')
-rw-r--r-- | container-core/src/main/java/com/yahoo/container/handler/test/MockServiceHandler.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/test/MockServiceHandler.java b/container-core/src/main/java/com/yahoo/container/handler/test/MockServiceHandler.java index 0a246431e43..2ef3d66d501 100644 --- a/container-core/src/main/java/com/yahoo/container/handler/test/MockServiceHandler.java +++ b/container-core/src/main/java/com/yahoo/container/handler/test/MockServiceHandler.java @@ -8,17 +8,17 @@ import com.yahoo.container.jdisc.HttpRequest; * A service handler that is able to map a request to a key and retrieve a value given a key. * * @author Ulf Lilleengen - * @since 5.1.21 */ @Beta public interface MockServiceHandler { + /** * Create a custom Key given a http request. This will be called for each request, and allows a handler * to customize its key format. * @param request The client http request. * @return a {@link Key} used to query for the value. */ - public Key createKey(HttpRequest request); + Key createKey(HttpRequest request); /** * Lookup a {@link Value} for a {@link Key}. Returns null if the key is not found. @@ -26,9 +26,10 @@ public interface MockServiceHandler { * @param key The {@link Key} to look up. * @return A {@link Value} used as response. */ - public Value get(Key key); + Value get(Key key); + + final class Value { - public final class Value { public final int returnCode; public final byte[] data; public final String contentType; @@ -38,10 +39,13 @@ public interface MockServiceHandler { this.data = data; this.contentType = contentType; } + } - public interface Key { - public int hashCode(); - public boolean equals(Object other); + interface Key { + + int hashCode(); + boolean equals(Object other); + } } |