final class OpaqueUriComponents extends UriComponents
UriComponents
for opaque URIs.UriComponents.UriTemplateVariables
Modifier and Type | Field and Description |
---|---|
private static MultiValueMap<java.lang.String,java.lang.String> |
QUERY_PARAMS_NONE |
private java.lang.String |
ssp |
Constructor and Description |
---|
OpaqueUriComponents(java.lang.String scheme,
java.lang.String schemeSpecificPart,
java.lang.String fragment) |
Modifier and Type | Method and Description |
---|---|
protected void |
copyToUriComponentsBuilder(UriComponentsBuilder builder)
Set all components of the given UriComponentsBuilder.
|
UriComponents |
encode(java.nio.charset.Charset charset)
A variant of
UriComponents.encode() with a charset other than "UTF-8". |
boolean |
equals(java.lang.Object other) |
protected UriComponents |
expandInternal(UriComponents.UriTemplateVariables uriVariables)
Replace all URI template variables with the values from the given
UriComponents.UriTemplateVariables . |
java.lang.String |
getHost()
Return the host.
|
java.lang.String |
getPath()
Return the path.
|
java.util.List<java.lang.String> |
getPathSegments()
Return the list of path segments.
|
int |
getPort()
Return the port.
|
java.lang.String |
getQuery()
Return the query.
|
MultiValueMap<java.lang.String,java.lang.String> |
getQueryParams()
Return the map of query parameters.
|
java.lang.String |
getSchemeSpecificPart()
Return the scheme specific part.
|
java.lang.String |
getUserInfo()
Return the user info.
|
int |
hashCode() |
UriComponents |
normalize()
Normalize the path removing sequences like "path/..".
|
java.net.URI |
toUri()
Create a
URI from this instance as follows: |
java.lang.String |
toUriString()
Concatenate all URI components to return the fully formed URI String.
|
encode, expand, expand, expand, expandUriComponent, expandUriComponent, getFragment, getScheme, toString
private static final MultiValueMap<java.lang.String,java.lang.String> QUERY_PARAMS_NONE
@Nullable private final java.lang.String ssp
@Nullable public java.lang.String getSchemeSpecificPart()
UriComponents
null
.getSchemeSpecificPart
in class UriComponents
@Nullable public java.lang.String getUserInfo()
UriComponents
null
.getUserInfo
in class UriComponents
@Nullable public java.lang.String getHost()
UriComponents
null
.getHost
in class UriComponents
public int getPort()
UriComponents
-1
if no port has been set.getPort
in class UriComponents
@Nullable public java.lang.String getPath()
UriComponents
null
.getPath
in class UriComponents
public java.util.List<java.lang.String> getPathSegments()
UriComponents
getPathSegments
in class UriComponents
@Nullable public java.lang.String getQuery()
UriComponents
null
.getQuery
in class UriComponents
public MultiValueMap<java.lang.String,java.lang.String> getQueryParams()
UriComponents
getQueryParams
in class UriComponents
public UriComponents encode(java.nio.charset.Charset charset)
UriComponents
UriComponents.encode()
with a charset other than "UTF-8".encode
in class UriComponents
charset
- the charset to use for encodingUriComponentsBuilder.encode(Charset)
protected UriComponents expandInternal(UriComponents.UriTemplateVariables uriVariables)
UriComponents
UriComponents.UriTemplateVariables
.expandInternal
in class UriComponents
uriVariables
- the URI template valuespublic UriComponents normalize()
UriComponents
normalize
in class UriComponents
StringUtils.cleanPath(String)
public java.lang.String toUriString()
UriComponents
This method does nothing more than a simple concatenation based on
current values. That means it could produce different results if invoked
before vs after methods that can change individual values such as
encode
, expand
, or normalize
.
toUriString
in class UriComponents
public java.net.URI toUri()
UriComponents
URI
from this instance as follows:
If the current instance is encoded
, form the full
URI String via UriComponents.toUriString()
, and then pass it to the single
argument URI
constructor which preserves percent encoding.
If not yet encoded, pass individual URI component values to the
multi-argument URI
constructor which quotes illegal characters
that cannot appear in their respective URI component.
toUri
in class UriComponents
protected void copyToUriComponentsBuilder(UriComponentsBuilder builder)
UriComponents
copyToUriComponentsBuilder
in class UriComponents
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object