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 URLStringConverterAn instance of this class.static final StringThe 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 URLStringConverterprovider()This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.
-
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:
fromStringin interfaceStringConverter<URL>- Throws:
IllegalArgumentException
-
getSubjectClass
Provides the subject class for this converter.- Returns:
- The subject class.
-
provider
This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.- Returns:
- The instance for this
StringConverterimplementation.
-
toString
- Specified by:
toStringin interfaceStringConverter<URL>
-
