public class ValueParserFactory
extends java.lang.Object
Constructor and Description |
---|
ValueParserFactory() |
Modifier and Type | Method and Description |
---|---|
static util.object.Either<java.lang.String,DatasetId> |
datasetId(java.lang.String value)
Creates a dataset ID from a positive integer.
|
static util.object.Either<java.lang.String,Email> |
email(java.lang.String value)
Creates an email from its string representation.
|
static <T> util.object.Either<java.lang.String,T> |
label(java.lang.String errorMsgPrefix,
util.object.Either<java.lang.String,T> value)
Prefixes the error message (i.e.
|
static util.object.Either<java.lang.String,java.time.Duration> |
millis(java.lang.String value)
Parses the string representation of a positive integer as a
Duration in milliseconds. |
static util.object.Either<java.lang.String,java.net.URI> |
omeroUri(java.lang.String host,
java.lang.String port)
Creates a URI from host and port components: the returned URI will be of
the form
omero://host:port/ . |
static util.object.Either<java.lang.String,PositiveN> |
positiveInt(java.lang.String value)
Creates a positive natural from its string representation.
|
static util.object.Either<java.lang.String,ScreenId> |
screenId(java.lang.String value)
Creates a screen ID from a positive integer.
|
static util.object.Either<java.lang.String,java.lang.String> |
string(java.lang.String value)
Parses a string of length at least one.
|
static util.object.Either<java.lang.String,java.net.URI> |
targetUri(java.lang.String value)
Creates a URI from the target field in the import request.
|
static util.object.Either<java.lang.String,TextAnnotation> |
textAnnotation(java.lang.String... xs)
Creates a text annotation from its string representation.
|
static util.object.Either<java.lang.String,java.net.URI> |
uri(java.lang.String value)
Creates a URI from its string representation.
|
public static util.object.Either<java.lang.String,DatasetId> datasetId(java.lang.String value)
value
- string representation of a positive integer.public static util.object.Either<java.lang.String,ScreenId> screenId(java.lang.String value)
value
- string representation of a positive integer.public static util.object.Either<java.lang.String,Email> email(java.lang.String value)
value
- string representation of an email address, e.g. x@y.edu
.public static util.object.Either<java.lang.String,PositiveN> positiveInt(java.lang.String value)
value
- string representation of a positive integer.public static util.object.Either<java.lang.String,TextAnnotation> textAnnotation(java.lang.String... xs)
xs
- a pair of strings: a namespace followed by the annotation
content.public static util.object.Either<java.lang.String,java.net.URI> uri(java.lang.String value)
value
- string representation of a URI, e.g. /some/file
.public static util.object.Either<java.lang.String,java.net.URI> targetUri(java.lang.String value)
value
- the target field.public static util.object.Either<java.lang.String,java.net.URI> omeroUri(java.lang.String host, java.lang.String port)
omero://host:port/
.host
- the host component of the URI.port
- the port component of the URI.public static util.object.Either<java.lang.String,java.lang.String> string(java.lang.String value)
value
- a string of length at least one.public static util.object.Either<java.lang.String,java.time.Duration> millis(java.lang.String value)
Duration
in milliseconds.value
- a string representation of a positive.public static <T> util.object.Either<java.lang.String,T> label(java.lang.String errorMsgPrefix, util.object.Either<java.lang.String,T> value)
p
so that if e
is the original message, the new
message will be of the form p:e
.T
- any type.errorMsgPrefix
- the string to prefix to the error message.value
- the input to prefix in the case it's a left value.java.lang.NullPointerException
- if any argument is null
.