Klasse StringMediator
java.lang.Object
ch.nolix.core.errorcontrol.validator.ArgumentMediator<String>
ch.nolix.core.errorcontrol.validator.StringMediator
- Bekannte direkte Unterklassen:
ExtendedStringMediator
- Version:
- 2016-09-01
- Autor:
- Silvan Wyss
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotected
StringMediator
(String argument) Creates a newStringMediator
for the given argument.protected
StringMediator
(String argumentName, String argument) Creates a newStringMediator
for the given argument, which has the given argumentName. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic StringMediator
forArgument
(String argument) protected final String
void
hasLength
(int length) void
isEmpty()
void
void
void
isNotLongerThan
(int maxLength) void
isNotShorterThan
(int minLength) void
void
startsWith
(String prefix) Von Klasse geerbte Methoden ch.nolix.core.errorcontrol.validator.ArgumentMediator
forArgument, fulfills, getStoredArgument, hasSameStringRepresentationAs, hasStringRepresentation, is, isEqualTo, isNot, isNotEqualTo, isNotNull, isNull, isOfType
-
Felddetails
-
DEFAULT_ARGUMENT_NAME
- Siehe auch:
-
-
Konstruktordetails
-
StringMediator
Creates a newStringMediator
for the given argument.- Parameter:
argument
-
-
StringMediator
Creates a newStringMediator
for the given argument, which has the given argumentName.- Parameter:
argumentName
-argument
-- Löst aus:
ArgumentIsNullException
- if the given argumentName is null.InvalidArgumentException
- if the given argumentName is blank.
-
-
Methodendetails
-
forArgument
- Parameter:
argument
-- Gibt zurück:
- a new
StringMediator
for the given argument.
-
hasLength
public void hasLength(int length) - Parameter:
length
-- Löst aus:
NegativeArgumentException
- if the given length is negative.ArgumentIsNullException
- if the argument of the currentStringMediator
is null.InvalidArgumentException
- if the argument of the currentStringMediator
does not have the given length.
-
isEmpty
public void isEmpty()- Löst aus:
ArgumentIsNullException
- if the argument of the currentStringMediator
is null.NonEmptyArgumentException
- if the argument of the currentStringMediator
is not empty.
-
isNotEmpty
public void isNotEmpty()- Löst aus:
ArgumentIsNullException
- if the argument of the currentStringMediator
is null.EmptyArgumentException
- if the argument of the currentStringMediator
is empty.
-
isNotBlank
public void isNotBlank()- Löst aus:
ArgumentIsNullException
- if the argument of the currentStringMediator
is null.InvalidArgumentException
- if the argument of the currentStringMediator
is blank.
-
isNotLongerThan
public void isNotLongerThan(int maxLength) - Parameter:
maxLength
-- Löst aus:
ArgumentIsNullException
- if the argument of the currentStringMediator
is null.InvalidArgumentException
- if the argument of the currentStringMediator
is longer than the given max length says.
-
isNotShorterThan
public void isNotShorterThan(int minLength) - Parameter:
minLength
-- Löst aus:
ArgumentIsNullException
- if the argument of the currentStringMediator
is null.InvalidArgumentException
- if the argument of the currentStringMediator
is shorter than the given min length says.
-
matches
- Parameter:
regularExpression
-- Löst aus:
InvalidArgumentException
- if the argument of the currentStringMediator
does not match the given regularExpression.
-
startsWith
- Parameter:
prefix
-- Löst aus:
ArgumentIsNullException
- if the given prefix is null.ArgumentIsNullException
- if the argument of the currentStringMediator
is null.InvalidArgumentException
- if the argument of the currentStringMediator
does not start with the given prefix.
-
getArgumentName
- Gibt zurück:
- the argument name of the current
Mediator
.
-