Package kong.unirest.core
Class FieldMatcher
- java.lang.Object
-
- kong.unirest.core.FieldMatcher
-
- All Implemented Interfaces:
BodyMatcher
public class FieldMatcher extends java.lang.Object implements BodyMatcher
Matches simple form fields
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>
formParams
-
Constructor Summary
Constructors Constructor Description FieldMatcher(java.util.Map<java.lang.String,java.lang.String> formParams)
Creates a FieldMatcher expecting a map of keys and values
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
description(boolean pass, java.util.List<java.lang.String> missing)
private static <K,V>
java.util.Map<K,V>mapOf(java.lang.Object... keyValues)
MatchStatus
matches(java.util.List<java.lang.String> body)
indicates if the Matcher succeeded in matching the bodystatic FieldMatcher
of(java.lang.String... keyValuePairs)
Creates a FieldMatcher expecting a map of keys and values use like: FieldMatcher.of("fruit", "orange", "quantity" "42")
-
-
-
Method Detail
-
of
public static FieldMatcher of(java.lang.String... keyValuePairs)
Creates a FieldMatcher expecting a map of keys and values use like: FieldMatcher.of("fruit", "orange", "quantity" "42")- Parameters:
keyValuePairs
- an array of key-value pairs to expect- Returns:
- a new FieldMatcher
-
matches
public MatchStatus matches(java.util.List<java.lang.String> body) throws java.lang.AssertionError
Description copied from interface:BodyMatcher
indicates if the Matcher succeeded in matching the body- Specified by:
matches
in interfaceBodyMatcher
- Parameters:
body
- the list of body parts- Returns:
- MatchStatus indicating if the Matcher succeeded in matching the body
- Throws:
java.lang.AssertionError
-
description
private java.lang.String description(boolean pass, java.util.List<java.lang.String> missing)
-
mapOf
private static <K,V> java.util.Map<K,V> mapOf(java.lang.Object... keyValues)
-
-