Module org.tquadrat.foundation.util
Class URLStringConverter
java.lang.Object
org.tquadrat.foundation.util.stringconverter.URLStringConverter
- All Implemented Interfaces:
Serializable
,StringConverter<URL>
- Direct Known Subclasses:
EncodedURLStringConverter
@ClassVersion(sourceVersion="$Id: URLStringConverter.java 1060 2023-09-24 19:21:40Z tquadrat $")
@API(status=STABLE,
since="0.0.6")
public sealed class URLStringConverter
extends Object
implements StringConverter<URL>
permits EncodedURLStringConverter
An implementation of
StringConverter
for
URL
values.
The method
fromString(CharSequence)
will use the constructor
URL(String)
to create a URL
instance from the given value.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: URLStringConverter.java 1060 2023-09-24 19:21:40Z tquadrat $
- Since:
- 0.0.6
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.util.stringconverter.URLStringConverter"
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final URLStringConverter
An instance of this class.static final String
The error message for an invalid URL: "\'%1$s\' cannot be parsed as a valid URL".Fields inherited from interface org.tquadrat.foundation.lang.StringConverter
METHOD_NAME_GetSubjectClass, METHOD_NAME_Provider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromString
(CharSequence source) final Collection
<Class<?>> Provides the subject class for this converter.static final URLStringConverter
provider()
This method is used by theServiceLoader
to obtain the instance for thisStringConverter
implementation.
-
Field Details
-
MSG_InvalidURL
The error message for an invalid URL: "\'%1$s\' cannot be parsed as a valid URL".- See Also:
-
INSTANCE
An instance of this class.
-
-
Constructor Details
-
URLStringConverter
public URLStringConverter()Creates a new instance ofURLStringConverter
.
-
-
Method Details
-
fromString
- Specified by:
fromString
in interfaceStringConverter<URL>
- Throws:
IllegalArgumentException
-
getSubjectClass
Provides the subject class for this converter.- Returns:
- The subject class.
-
provider
This method is used by theServiceLoader
to obtain the instance for thisStringConverter
implementation.- Returns:
- The instance for this
StringConverter
implementation.
-
toString
- Specified by:
toString
in interfaceStringConverter<URL>
-