-
- All Implemented Interfaces:
-
mu.KLoggable
public class Matchers.Companion extends KLogging
-
-
Field Summary
Fields Modifier and Type Field Description private final LongDATE_2000private final KLoggerloggerpublic final static Matchers.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final Matcherregexp(Pattern re, String value)Match a regular expression final Matcherregexp(Pattern re)Match a regular expression final Matcherregexp(String regexp, String value)Match a regular expression final Matcherregexp(String regexp)Match a regular expression final MatcherhexValue(String value)Match a hexadecimal value final MatcherhexValue()Match a hexadecimal value final Matcheridentifier(Object value)Match a numeric identifier (integer) final Matcheridentifier()Match a numeric identifier (integer) final MatcheripAddress(String value)Match an IP Address final MatcheripAddress()Match an IP Address final Matchernumeric(Number value)Match a numeric value final Matchernumeric()Match a numeric value final Matcherdecimal(Number value)Match a decimal value final Matcherdecimal()Match a decimal value final Matcherinteger(Long value)Match a integer value final Matcherinteger()Match a integer value final Matcherdatetime(String pattern, String value)Match a datetime final Matcherdatetime(String pattern)Match a datetime final Matcherdatetime()Match a datetime final MatcherdatetimeExpression(String expression, String pattern)Match a datetime generated from an expression final Matchertime(String pattern, String value)Match a time final Matchertime(String pattern)Match a time final Matchertime()Match a time final MatchertimeExpression(String expression, String pattern)Match a time generated from an expression final MatchertimeExpression(String expression)Match a time generated from an expression final Matcherdate(String pattern, String value)Match a date final Matcherdate(String pattern)Match a date final Matcherdate()Match a date final MatcherdateExpression(String expression, String pattern)Match a date generated from an expression final MatcherdateExpression(String expression)Match a date generated from an expression final Matcheruuid(String value)Match a universally unique identifier (UUID) final Matcheruuid()Match a universally unique identifier (UUID) final Matcherstring(String value)Match any string value final Matcherstring()Match any string value final Matcherbool(Boolean value)Match any boolean final Matcherbool()Match any boolean final MatchereachLike(Integer numberExamples, Object arg)Array where each element like the following object final MatchereachLike(Object arg)Array where each element like the following object final MatchermaxLike(Integer max, Integer numberExamples, Object arg)Array with maximum size and each element like the following object final MatchermaxLike(Integer max, Object arg)Array with maximum size and each element like the following object final MatcherminLike(Integer min, Integer numberExamples, Object arg)Array with minimum size and each element like the following object final MatcherminLike(Integer min, Object arg)Array with minimum size and each element like the following object final MatcherminMaxLike(Integer min, Integer max, Integer numberExamples, Object arg)Array with minimum and maximum size and each element like the following object final MatcherminMaxLike(Integer min, Integer max, Object arg)Array with minimum and maximum size and each element like the following object final MatcherequalTo(Object value)Match Equality final MatcherincludesStr(String value)Matches if the string is included in the value final Matcheror(Object example, Object values)Matches if any of the provided matches match final Matcherand(Object example, Object values)Matches if all of the provided matches match final MatchernullValue()Matches a null value final Matcherurl(String basePath, Object pathFragments)Matches a URL composed of a base path and a list of path fragments final MatchereachArrayLike(Integer numberExamples, Object arg)Array of arrays where each element like the following object final MatchereachArrayLike(Object arg)Array of arrays where each element like the following object final StatusCodeMatcherinformationStatus()Match any HTTP Information response status (100-199) final StatusCodeMatchersuccessStatus()Match any HTTP success response status (200-299) final StatusCodeMatcherredirectStatus()Match any HTTP redirect response status (300-399) final StatusCodeMatcherclientErrorStatus()Match any HTTP client error response status (400-499) final StatusCodeMatcherserverErrorStatus()Match any HTTP server error response status (500-599) final StatusCodeMatchernonErrorStatus()Match any HTTP non-error response status (< 400) final StatusCodeMatchererrorStatus()Match any HTTP error response status (>= 400) final StatusCodeMatcherstatusCodes(List<Integer> statusCodes)Match any HTTP status code in the provided list final LonggetDATE_2000()-
-
Method Detail
-
regexp
@JvmOverloads() final Matcher regexp(Pattern re, String value)
Match a regular expression
- Parameters:
re- Regular expression patternvalue- Example value, if not provided a random one will be generated
-
regexp
@JvmOverloads() final Matcher regexp(Pattern re)
Match a regular expression
- Parameters:
re- Regular expression pattern
-
regexp
@JvmOverloads() final Matcher regexp(String regexp, String value)
Match a regular expression
- Parameters:
value- Example value, if not provided a random one will be generated
-
regexp
@JvmOverloads() final Matcher regexp(String regexp)
Match a regular expression
-
hexValue
@JvmOverloads() final Matcher hexValue(String value)
Match a hexadecimal value
- Parameters:
value- Example value, if not provided a random one will be generated
-
hexValue
@JvmOverloads() final Matcher hexValue()
Match a hexadecimal value
-
identifier
@JvmOverloads() final Matcher identifier(Object value)
Match a numeric identifier (integer)
- Parameters:
value- Example value, if not provided a random one will be generated
-
identifier
@JvmOverloads() final Matcher identifier()
Match a numeric identifier (integer)
-
ipAddress
@JvmOverloads() final Matcher ipAddress(String value)
Match an IP Address
- Parameters:
value- Example value, if not provided 127.0.0.
-
ipAddress
@JvmOverloads() final Matcher ipAddress()
Match an IP Address
-
numeric
@JvmOverloads() final Matcher numeric(Number value)
Match a numeric value
- Parameters:
value- Example value, if not provided a random one will be generated
-
numeric
@JvmOverloads() final Matcher numeric()
Match a numeric value
-
decimal
@JvmOverloads() final Matcher decimal(Number value)
Match a decimal value
- Parameters:
value- Example value, if not provided a random one will be generated
-
decimal
@JvmOverloads() final Matcher decimal()
Match a decimal value
-
integer
@JvmOverloads() final Matcher integer(Long value)
Match a integer value
- Parameters:
value- Example value, if not provided a random one will be generated
-
integer
@JvmOverloads() final Matcher integer()
Match a integer value
-
datetime
@JvmOverloads() final Matcher datetime(String pattern, String value)
Match a datetime
- Parameters:
pattern- Pattern to use to match.value- Example value, if not provided the current date and time will be used
-
datetime
@JvmOverloads() final Matcher datetime(String pattern)
Match a datetime
- Parameters:
pattern- Pattern to use to match.
-
datetime
@JvmOverloads() final Matcher datetime()
Match a datetime
-
datetimeExpression
final Matcher datetimeExpression(String expression, String pattern)
Match a datetime generated from an expression
- Parameters:
expression- Expression to use to generate the datetimepattern- Pattern to use to match.
-
time
@JvmOverloads() final Matcher time(String pattern, String value)
Match a time
- Parameters:
pattern- Pattern to use to match.value- Example value, if not provided the current time will be used
-
time
@JvmOverloads() final Matcher time(String pattern)
Match a time
- Parameters:
pattern- Pattern to use to match.
-
time
@JvmOverloads() final Matcher time()
Match a time
-
timeExpression
@JvmOverloads() final Matcher timeExpression(String expression, String pattern)
Match a time generated from an expression
- Parameters:
expression- Expression to use to generate the timepattern- Pattern to use to match.
-
timeExpression
@JvmOverloads() final Matcher timeExpression(String expression)
Match a time generated from an expression
- Parameters:
expression- Expression to use to generate the time
-
date
@JvmOverloads() final Matcher date(String pattern, String value)
Match a date
- Parameters:
pattern- Pattern to use to match.value- Example value, if not provided the current date will be used
-
date
@JvmOverloads() final Matcher date(String pattern)
Match a date
- Parameters:
pattern- Pattern to use to match.
-
date
@JvmOverloads() final Matcher date()
Match a date
-
dateExpression
@JvmOverloads() final Matcher dateExpression(String expression, String pattern)
Match a date generated from an expression
- Parameters:
expression- Expression to use to generate the datepattern- Pattern to use to match.
-
dateExpression
@JvmOverloads() final Matcher dateExpression(String expression)
Match a date generated from an expression
- Parameters:
expression- Expression to use to generate the date
-
uuid
@JvmOverloads() final Matcher uuid(String value)
Match a universally unique identifier (UUID)
- Parameters:
value- optional value to use for examples
-
uuid
@JvmOverloads() final Matcher uuid()
Match a universally unique identifier (UUID)
-
string
@JvmOverloads() final Matcher string(String value)
Match any string value
- Parameters:
value- Example value, if not provided a random one will be generated
-
string
@JvmOverloads() final Matcher string()
Match any string value
-
bool
@JvmOverloads() final Matcher bool(Boolean value)
Match any boolean
- Parameters:
value- Example value, if not provided a random one will be generated
-
bool
@JvmOverloads() final Matcher bool()
Match any boolean
-
eachLike
@JvmOverloads() final Matcher eachLike(Integer numberExamples, Object arg)
Array where each element like the following object
- Parameters:
numberExamples- Optional number of examples to generate.
-
eachLike
@JvmOverloads() final Matcher eachLike(Object arg)
Array where each element like the following object
-
maxLike
@JvmOverloads() final Matcher maxLike(Integer max, Integer numberExamples, Object arg)
Array with maximum size and each element like the following object
- Parameters:
max- The maximum size of the arraynumberExamples- Optional number of examples to generate.
-
maxLike
@JvmOverloads() final Matcher maxLike(Integer max, Object arg)
Array with maximum size and each element like the following object
- Parameters:
max- The maximum size of the array
-
minLike
@JvmOverloads() final Matcher minLike(Integer min, Integer numberExamples, Object arg)
Array with minimum size and each element like the following object
- Parameters:
min- The minimum size of the arraynumberExamples- Optional number of examples to generate.
-
minLike
@JvmOverloads() final Matcher minLike(Integer min, Object arg)
Array with minimum size and each element like the following object
- Parameters:
min- The minimum size of the array
-
minMaxLike
@JvmOverloads() final Matcher minMaxLike(Integer min, Integer max, Integer numberExamples, Object arg)
Array with minimum and maximum size and each element like the following object
- Parameters:
min- The minimum size of the arraymax- The maximum size of the arraynumberExamples- Optional number of examples to generate.
-
minMaxLike
@JvmOverloads() final Matcher minMaxLike(Integer min, Integer max, Object arg)
Array with minimum and maximum size and each element like the following object
- Parameters:
min- The minimum size of the arraymax- The maximum size of the array
-
includesStr
final Matcher includesStr(String value)
Matches if the string is included in the value
- Parameters:
value- String value that must be present
-
or
final Matcher or(Object example, Object values)
Matches if any of the provided matches match
- Parameters:
example- Example value to use
-
and
final Matcher and(Object example, Object values)
Matches if all of the provided matches match
- Parameters:
example- Example value to use
-
url
final Matcher url(String basePath, Object pathFragments)
Matches a URL composed of a base path and a list of path fragments
-
eachArrayLike
@JvmOverloads() final Matcher eachArrayLike(Integer numberExamples, Object arg)
Array of arrays where each element like the following object
- Parameters:
numberExamples- Optional number of examples to generate.
-
eachArrayLike
@JvmOverloads() final Matcher eachArrayLike(Object arg)
Array of arrays where each element like the following object
-
informationStatus
final StatusCodeMatcher informationStatus()
Match any HTTP Information response status (100-199)
-
successStatus
final StatusCodeMatcher successStatus()
Match any HTTP success response status (200-299)
-
redirectStatus
final StatusCodeMatcher redirectStatus()
Match any HTTP redirect response status (300-399)
-
clientErrorStatus
final StatusCodeMatcher clientErrorStatus()
Match any HTTP client error response status (400-499)
-
serverErrorStatus
final StatusCodeMatcher serverErrorStatus()
Match any HTTP server error response status (500-599)
-
nonErrorStatus
final StatusCodeMatcher nonErrorStatus()
Match any HTTP non-error response status (< 400)
-
errorStatus
final StatusCodeMatcher errorStatus()
Match any HTTP error response status (>= 400)
-
statusCodes
final StatusCodeMatcher statusCodes(List<Integer> statusCodes)
Match any HTTP status code in the provided list
-
getDATE_2000
final Long getDATE_2000()
-
-
-
-