public class CrudDispatcher
extends okhttp3.mockwebserver.Dispatcher
| Modifier and Type | Field and Description |
|---|---|
protected AttributeExtractor |
attributeExtractor |
protected Context |
context |
protected Map<AttributeSet,String> |
map |
protected ResponseComposer |
responseComposer |
| Constructor and Description |
|---|
CrudDispatcher(Context context,
AttributeExtractor attributeExtractor,
ResponseComposer responseComposer) |
| Modifier and Type | Method and Description |
|---|---|
okhttp3.mockwebserver.MockResponse |
dispatch(okhttp3.mockwebserver.RecordedRequest request) |
AttributeExtractor |
getAttributeExtractor() |
Map<AttributeSet,String> |
getMap() |
ResponseComposer |
getResponseComposer() |
okhttp3.mockwebserver.MockResponse |
handleCreate(String path,
String s)
Adds the specified object to the in-memory db.
|
okhttp3.mockwebserver.MockResponse |
handleDelete(String path)
Performs a delete for the corresponding object from the in-memory db.
|
okhttp3.mockwebserver.MockResponse |
handleGet(String path)
Performs a get for the corresponding object from the in-memory db.
|
okhttp3.mockwebserver.MockResponse |
handlePatch(String path,
String s)
Patches the specified object to the in-memory db.
|
okhttp3.mockwebserver.MockResponse |
handleUpdate(String path,
String s)
Updates the specified object to the in-memory db.
|
protected Map<AttributeSet,String> map
protected final Context context
protected final AttributeExtractor attributeExtractor
protected final ResponseComposer responseComposer
public CrudDispatcher(Context context, AttributeExtractor attributeExtractor, ResponseComposer responseComposer)
public okhttp3.mockwebserver.MockResponse dispatch(okhttp3.mockwebserver.RecordedRequest request)
throws InterruptedException
dispatch in class okhttp3.mockwebserver.DispatcherInterruptedExceptionpublic okhttp3.mockwebserver.MockResponse handleCreate(String path, String s)
path - s - public okhttp3.mockwebserver.MockResponse handlePatch(String path, String s)
path - s - public okhttp3.mockwebserver.MockResponse handleUpdate(String path, String s)
path - s - public okhttp3.mockwebserver.MockResponse handleGet(String path)
path - The path.MockResponsepublic okhttp3.mockwebserver.MockResponse handleDelete(String path)
path - public Map<AttributeSet,String> getMap()
public AttributeExtractor getAttributeExtractor()
public ResponseComposer getResponseComposer()
Copyright © 2015–2020 Red Hat. All rights reserved.