public class URLProtocol extends Object implements IURLProtocol
IURLProtocol interface.| Constructor and Description |
|---|
URLProtocol(String sProtocol,
boolean bAllowsForQueryParameters) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowsForQueryParameters() |
boolean |
equals(Object o) |
String |
getProtocol() |
String |
getWithProtocol(String sURL)
Prefix the passed URL with this protocol.
|
String |
getWithProtocolIfNone(String sURL)
Prefix the passed URL with this protocol if the URL does not have a
protocol yet.
|
int |
hashCode() |
boolean |
isUsedInURL(String sURL)
Tells if the passed String (URL) belongs to this protocol.
|
String |
toString() |
@Nonnull @Nonempty public String getProtocol()
getProtocol in interface IURLProtocolpublic boolean isUsedInURL(@Nullable String sURL)
isUsedInURL in interface IURLProtocolsURL - The URL to check. May be null.true if the passed URL starts with this protocol@Nullable public String getWithProtocol(@Nullable String sURL)
IURLProtocolgetWithProtocol in interface IURLProtocolsURL - The URL to be prefixed. May be null.null if the parameter is null. The
protocol is prepended independent whether the URL already has a
protocol or not.@Nullable public String getWithProtocolIfNone(@Nullable String sURL)
IURLProtocolgetWithProtocolIfNone in interface IURLProtocolsURL - The URL to be prefixed. May be null.null if the parameter is null. The
protocol is prepended if the URL not already has a protocol.public boolean allowsForQueryParameters()
allowsForQueryParameters in interface IURLProtocoltrue if this protocol can handle HTTP query parameters
(?x=y&z=1)Copyright © 2014–2020 Philip Helger. All rights reserved.