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
KonstruktorenModifiziererKonstruktorBeschreibungprotectedStringMediator(String argument) Creates a newStringMediatorfor the given argument.protectedStringMediator(String argumentName, String argument) Creates a newStringMediatorfor the given argument, which has the given argumentName. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic StringMediatorforArgument(String argument) protected final StringvoidhasLength(int length) voidisEmpty()voidvoidvoidisNotLongerThan(int maxLength) voidisNotShorterThan(int minLength) voidvoidstartsWith(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 newStringMediatorfor the given argument.- Parameter:
argument-
-
StringMediator
Creates a newStringMediatorfor 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
StringMediatorfor 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 currentStringMediatoris null.InvalidArgumentException- if the argument of the currentStringMediatordoes not have the given length.
-
isEmpty
public void isEmpty()- Löst aus:
ArgumentIsNullException- if the argument of the currentStringMediatoris null.NonEmptyArgumentException- if the argument of the currentStringMediatoris not empty.
-
isNotEmpty
public void isNotEmpty()- Löst aus:
ArgumentIsNullException- if the argument of the currentStringMediatoris null.EmptyArgumentException- if the argument of the currentStringMediatoris empty.
-
isNotBlank
public void isNotBlank()- Löst aus:
ArgumentIsNullException- if the argument of the currentStringMediatoris null.InvalidArgumentException- if the argument of the currentStringMediatoris blank.
-
isNotLongerThan
public void isNotLongerThan(int maxLength) - Parameter:
maxLength-- Löst aus:
ArgumentIsNullException- if the argument of the currentStringMediatoris null.InvalidArgumentException- if the argument of the currentStringMediatoris longer than the given max length says.
-
isNotShorterThan
public void isNotShorterThan(int minLength) - Parameter:
minLength-- Löst aus:
ArgumentIsNullException- if the argument of the currentStringMediatoris null.InvalidArgumentException- if the argument of the currentStringMediatoris shorter than the given min length says.
-
matches
- Parameter:
regularExpression-- Löst aus:
InvalidArgumentException- if the argument of the currentStringMediatordoes not match the given regularExpression.
-
startsWith
- Parameter:
prefix-- Löst aus:
ArgumentIsNullException- if the given prefix is null.ArgumentIsNullException- if the argument of the currentStringMediatoris null.InvalidArgumentException- if the argument of the currentStringMediatordoes not start with the given prefix.
-
getArgumentName
- Gibt zurück:
- the argument name of the current
Mediator.
-