forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryString.java
More file actions
44 lines (39 loc) · 1007 Bytes
/
QueryString.java
File metadata and controls
44 lines (39 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Jooby https://jooby.io
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
* Copyright 2014 Edgar Espina
*/
package io.jooby;
import io.jooby.internal.UrlParser;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* Query string class for direct MVC parameter provisioning.
*
* @author edgar
* @since 2.0.0
*/
public interface QueryString extends ValueNode {
/**
* Query string with the leading <code>?</code> or empty string.
*
* @return Query string with the leading <code>?</code> or empty string.
*/
@Nonnull String queryString();
/**
* Query string hash value.
*
* <pre>{@code q=foo&sort=name}</pre>
*
* Produces:
*
* <pre>{@code {q: foo, sort: name}}</pre>
*
* @param ctx Current context.
* @param queryString Query string.
* @return A query string.
*/
static @Nonnull QueryString create(@Nonnull Context ctx, @Nullable String queryString) {
return UrlParser.queryString(ctx, queryString);
}
}