Top Description Fields Constructors Methods
org.springframework.web.util

pack-priv final Class OpaqueUriComponents

extends UriComponents
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.net.URI, .URISyntaxException, java.nio.charset.Charset, java.util.Collections, .List, .Objects, org.springframework.lang.Nullable, org.springframework.util.LinkedMultiValueMap, .MultiValueMap, .ObjectUtils

Extension of UriComponents for opaque URIs.
Authors
Arjen Poutsma, Phillip Webb
Since
3.2
See Also
Hierarchical vs Opaque URIs

Field Summary

Modifier and TypeField and Description
private static final MultiValueMap<String, String>
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
OpaqueUriComponents(String scheme, String schemeSpecificPart, String fragment)

Method Summary

Modifier and TypeMethod and Description
protected void
copyToUriComponentsBuilder(UriComponentsBuilder builder)

Implements abstract org.springframework.web.util.UriComponents.copyToUriComponentsBuilder.

Set all components of the given UriComponentsBuilder.
public UriComponents
encode(Charset
the charset to use for encoding
charset
)

Implements abstract org.springframework.web.util.UriComponents.encode.

A variant of encode() with a charset other than "UTF-8".
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
protected UriComponents
expandInternal(UriComponents.UriTemplateVariables
the URI template values
uriVariables
)

Implements abstract org.springframework.web.util.UriComponents.expandInternal.

Replace all URI template variables with the values from the given UriTemplateVariables.
public String
getHost()

Implements abstract org.springframework.web.util.UriComponents.getHost.

Return the host.
public String
getPath()

Implements abstract org.springframework.web.util.UriComponents.getPath.

Return the path.
public List<String>
getPathSegments()

Implements abstract org.springframework.web.util.UriComponents.getPathSegments.

Return the list of path segments.
public int
getPort()

Implements abstract org.springframework.web.util.UriComponents.getPort.

Return the port.
public String
getQuery()

Implements abstract org.springframework.web.util.UriComponents.getQuery.

Return the query.
public MultiValueMap<String, String>
getQueryParams()

Implements abstract org.springframework.web.util.UriComponents.getQueryParams.

Return the map of query parameters.
public String
getSchemeSpecificPart()

Implements abstract org.springframework.web.util.UriComponents.getSchemeSpecificPart.

Return the scheme specific part.
public String
getUserInfo()

Implements abstract org.springframework.web.util.UriComponents.getUserInfo.

Return the user info.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public UriComponents
normalize()

Implements abstract org.springframework.web.util.UriComponents.normalize.

Normalize the path removing sequences like "path/..".
public URI
toUri()

Implements abstract org.springframework.web.util.UriComponents.toUri.

Create a URI from this instance as follows:

If the current instance is encoded, form the full URI String via toUriString(), and then pass it to the single argument URI constructor which preserves percent encoding.

public String
toUriString()

Implements abstract org.springframework.web.util.UriComponents.toUriString.

Concatenate all URI components to return the fully formed URI String.
Inherited from org.springframework.web.util.UriComponents:
encodeexpandexpandexpandexpandUriComponentexpandUriComponentgetFragmentgetSchemetoString

Field Detail

QUERY_PARAMS_NONEback to summary
private static final MultiValueMap<String, String> QUERY_PARAMS_NONE
sspback to summary
private final String ssp
Annotations
@Nullable

Constructor Detail

OpaqueUriComponentsback to summary
pack-priv OpaqueUriComponents(String scheme, String schemeSpecificPart, String fragment)

Method Detail

copyToUriComponentsBuilderback to summary
protected void copyToUriComponentsBuilder(UriComponentsBuilder builder)

Implements abstract org.springframework.web.util.UriComponents.copyToUriComponentsBuilder.

Doc from org.springframework.web.util.UriComponents.copyToUriComponentsBuilder.

Set all components of the given UriComponentsBuilder.

Annotations
@Override
encodeback to summary
public UriComponents encode(Charset charset)

Implements abstract org.springframework.web.util.UriComponents.encode.

Doc from org.springframework.web.util.UriComponents.encode.

A variant of encode() with a charset other than "UTF-8".

Parameters
charset:Charset

the charset to use for encoding

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
expandInternalback to summary
protected UriComponents expandInternal(UriComponents.UriTemplateVariables uriVariables)

Implements abstract org.springframework.web.util.UriComponents.expandInternal.

Doc from org.springframework.web.util.UriComponents.expandInternal.

Replace all URI template variables with the values from the given UriTemplateVariables.

Parameters
uriVariables:UriComponents.UriTemplateVariables

the URI template values

Returns:UriComponents

the expanded URI components

Annotations
@Override
getHostback to summary
public String getHost()

Implements abstract org.springframework.web.util.UriComponents.getHost.

Doc from org.springframework.web.util.UriComponents.getHost.

Return the host. Can be null.

Annotations
@Override
@Nullable
getPathback to summary
public String getPath()

Implements abstract org.springframework.web.util.UriComponents.getPath.

Doc from org.springframework.web.util.UriComponents.getPath.

Return the path. Can be null.

Annotations
@Override
@Nullable
getPathSegmentsback to summary
public List<String> getPathSegments()

Implements abstract org.springframework.web.util.UriComponents.getPathSegments.

Doc from org.springframework.web.util.UriComponents.getPathSegments.

Return the list of path segments. Empty if no path has been set.

Annotations
@Override
getPortback to summary
public int getPort()

Implements abstract org.springframework.web.util.UriComponents.getPort.

Doc from org.springframework.web.util.UriComponents.getPort.

Return the port. -1 if no port has been set.

Annotations
@Override
getQueryback to summary
public String getQuery()

Implements abstract org.springframework.web.util.UriComponents.getQuery.

Doc from org.springframework.web.util.UriComponents.getQuery.

Return the query. Can be null.

Annotations
@Override
@Nullable
getQueryParamsback to summary
public MultiValueMap<String, String> getQueryParams()

Implements abstract org.springframework.web.util.UriComponents.getQueryParams.

Doc from org.springframework.web.util.UriComponents.getQueryParams.

Return the map of query parameters. Empty if no query has been set.

Annotations
@Override
getSchemeSpecificPartback to summary
public String getSchemeSpecificPart()

Implements abstract org.springframework.web.util.UriComponents.getSchemeSpecificPart.

Doc from org.springframework.web.util.UriComponents.getSchemeSpecificPart.

Return the scheme specific part. Can be null.

Annotations
@Override
@Nullable
getUserInfoback to summary
public String getUserInfo()

Implements abstract org.springframework.web.util.UriComponents.getUserInfo.

Doc from org.springframework.web.util.UriComponents.getUserInfo.

Return the user info. Can be null.

Annotations
@Override
@Nullable
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
normalizeback to summary
public UriComponents normalize()

Implements abstract org.springframework.web.util.UriComponents.normalize.

Doc from org.springframework.web.util.UriComponents.normalize.

Normalize the path removing sequences like "path/..". Note that normalization is applied to the full path, and not to individual path segments.

Annotations
@Override
toUriback to summary
public URI toUri()

Implements abstract org.springframework.web.util.UriComponents.toUri.

Doc from org.springframework.web.util.UriComponents.toUri.

Create a URI from this instance as follows:

If the current instance is encoded, form the full URI String via 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.

Annotations
@Override
toUriStringback to summary
public String toUriString()

Implements abstract org.springframework.web.util.UriComponents.toUriString.

Doc from org.springframework.web.util.UriComponents.toUriString.

Concatenate all URI components to return the fully formed URI String.

This method amounts to simple String concatenation of the current URI component values and as such the result may contain illegal URI characters, for example if URI variables have not been expanded or if encoding has not been applied via UriComponentsBuilder#encode() or encode().

Annotations
@Override