Package net.jadler.stubbing
Class StubResponse
- java.lang.Object
-
- net.jadler.stubbing.StubResponse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStubResponse.BuilderA builder class for creating newStubResponseinstances.
-
Field Summary
Fields Modifier and Type Field Description static StubResponseEMPTYAn empty stub response containing nothing but defaults (empty body, http status 200, no headers and no delay)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StubResponse.Builderbuilder()byte[]getBody()longgetDelay()CharsetgetEncoding()KeyValuesgetHeaders()intgetStatus()StringtoString()
-
-
-
Field Detail
-
EMPTY
public static final StubResponse EMPTY
An empty stub response containing nothing but defaults (empty body, http status 200, no headers and no delay)
-
-
Method Detail
-
builder
public static StubResponse.Builder builder()
- Returns:
- new builder for creating
StubResponseinstances
-
getStatus
public int getStatus()
- Returns:
- http status of the stub response
-
getBody
public byte[] getBody()
- Returns:
- response body as an array of bytes
-
getEncoding
public Charset getEncoding()
- Returns:
- encoding of the body (
nullif not set)
-
getHeaders
public KeyValues getHeaders()
- Returns:
- stub response headers
-
getDelay
public long getDelay()
- Returns:
- a delay (in millis) this stub response will be returned after
-
-