Package com.saicone.types.parser
Class UrlParser
- java.lang.Object
-
- com.saicone.types.parser.UrlParser
-
- All Implemented Interfaces:
TypeParser<URL>
public class UrlParser extends Object implements TypeParser<URL>
Represents a parser that try to convert any object type to URL.
This parser is compatible with File, Path, URI and String object types.
-
-
Constructor Summary
Constructors Constructor Description UrlParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable Type
getType()
Get the associated type object with this parser.@Nullable URL
parse(@NotNull Object object)
Parse the given object into required type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.saicone.types.TypeParser
andThen, andThen, array, array, collection, collection, completableFuture, isInstance, list, list, optional, optional, parse, parse, parseArray, parseArray, parseOrDefault, parseOrDefault, set, set, supplyAsync, supplyAsync
-
-
-
-
Method Detail
-
getType
@Nullable public @Nullable Type getType()
Description copied from interface:TypeParser
Get the associated type object with this parser.- Specified by:
getType
in interfaceTypeParser<URL>
- Returns:
- a type object if present, null otherwise.
-
parse
@Nullable public @Nullable URL parse(@NotNull @NotNull Object object)
Description copied from interface:TypeParser
Parse the given object into required type.- Specified by:
parse
in interfaceTypeParser<URL>
- Parameters:
object
- the object to parse.- Returns:
- a converted value type, null otherwise.
-
-