Package com.mastfrog.url
Enum Protocols
- All Implemented Interfaces:
Protocol,URLComponent,Serializable,Comparable<Protocols>,java.lang.constant.Constable
Enum of standard URL protocols.
- Author:
- Tim Boudreau
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidAppend this component to a StringBuilder.static ProtocolGet a human-readable, localized name for this part of the URL.getName()booleanisInsecureVersionOf(Protocol other) booleanbooleanbooleanisSecure()booleanisSecureVersionOf(Protocol other) booleanisValid()Determine if this component is in compliance with the RFCs governing URLs and DNS.booleanbooleantoString()static ProtocolsReturns the enum constant of this type with the specified name.static Protocols[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
HTTP
-
HTTPS
-
FTP
-
FILE
-
WS
-
WSS
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getName
-
getDefaultPort
- Specified by:
getDefaultPortin interfaceProtocol
-
isSecure
public boolean isSecure() -
match
-
match
-
isValid
public boolean isValid()Description copied from interface:URLComponentDetermine if this component is in compliance with the RFCs governing URLs and DNS.- Specified by:
isValidin interfaceURLComponent- Returns:
- True if this component is valid.
-
forName
-
isKnownProtocol
public boolean isKnownProtocol()- Specified by:
isKnownProtocolin interfaceProtocol
-
getComponentName
Description copied from interface:URLComponentGet a human-readable, localized name for this part of the URL. Useful if an error message needs to be shown.- Specified by:
getComponentNamein interfaceURLComponent- Returns:
- The component name
-
appendTo
Description copied from interface:URLComponentAppend this component to a StringBuilder.- Specified by:
appendToin interfaceURLComponent- Parameters:
sb- A StringBuilder
-
isNetworkProtocol
public boolean isNetworkProtocol()- Specified by:
isNetworkProtocolin interfaceProtocol
-
toString
-
isSecureVersionOf
- Specified by:
isSecureVersionOfin interfaceProtocol
-
isInsecureVersionOf
- Specified by:
isInsecureVersionOfin interfaceProtocol
-