Klasse StringMediator
java.lang.Object
ch.nolix.core.errorcontrol.validator.ArgumentMediator<String>
ch.nolix.core.errorcontrol.validator.StringMediator
- Bekannte direkte Unterklassen:
ExtendedStringMediator
- Autor:
- Silvan Wyss
-
Feldübersicht
Felder -
Methodenübersicht
Modifikator und TypMethodeBeschreibungstatic StringMediatorforArgument(String argument) voidhasLength(int length) voidisEmpty()voidvoidvoidisNotLongerThan(int maxLength) voidisNotShorterThan(int minLength) voidvoidstartsWith(String prefix) Von Klasse geerbte Methoden ArgumentMediator
forArgument, fulfills, hasSameStringRepresentationAs, hasStringRepresentation, is, isEqualTo, isNot, isNotEqualTo, isNotNull, isNull, isOfType
-
Felddetails
-
DEFAULT_ARGUMENT_NAME
- Siehe auch:
-
-
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.
-