Package com.funnelback.filter.api.mock
Class MockDocumentType
- java.lang.Object
-
- com.funnelback.filter.api.mock.MockDocumentType
-
- All Implemented Interfaces:
com.funnelback.filter.api.DocumentType
public class MockDocumentType extends Object implements com.funnelback.filter.api.DocumentType
Use this to create a DocumentType for testing when a preexisting DocumentType on the interfaceDocumentType
doesn't already exist. Example creating a DocumentType that claims to be HTML with a specific value for what is returned byDocumentType.asContentType()
.new MockDocumentType().withHTML(true).withContentType("something/specific");
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MockDocumentType.MockDocumentTypeBuilder
-
Field Summary
Fields Modifier and Type Field Description String
contentType
boolean
HTML
boolean
JSON
boolean
XML
-
Constructor Summary
Constructors Modifier Constructor Description MockDocumentType()
Construct a DocumentType where the cotent type is unknown.private
MockDocumentType(boolean HTML, boolean XML, boolean JSON, String contentType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
asContentType()
static MockDocumentType.MockDocumentTypeBuilder
builder()
boolean
isHTML()
boolean
isJSON()
boolean
isXML()
void
setContentType(String contentType)
void
setHTML(boolean HTML)
void
setJSON(boolean JSON)
void
setXML(boolean XML)
MockDocumentType
withContentType(String contentType)
MockDocumentType
withHTML(boolean HTML)
MockDocumentType
withJSON(boolean JSON)
MockDocumentType
withXML(boolean XML)
-
-
-
Field Detail
-
HTML
public boolean HTML
-
XML
public boolean XML
-
JSON
public boolean JSON
-
contentType
public String contentType
-
-
Constructor Detail
-
MockDocumentType
public MockDocumentType()
Construct a DocumentType where the cotent type is unknown.
-
MockDocumentType
private MockDocumentType(boolean HTML, boolean XML, boolean JSON, String contentType)
-
-
Method Detail
-
asContentType
public String asContentType()
- Specified by:
asContentType
in interfacecom.funnelback.filter.api.DocumentType
-
builder
public static MockDocumentType.MockDocumentTypeBuilder builder()
-
setHTML
public void setHTML(boolean HTML)
-
setXML
public void setXML(boolean XML)
-
setJSON
public void setJSON(boolean JSON)
-
setContentType
public void setContentType(String contentType)
-
isHTML
public boolean isHTML()
- Specified by:
isHTML
in interfacecom.funnelback.filter.api.DocumentType
-
withHTML
public MockDocumentType withHTML(boolean HTML)
- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
isXML
public boolean isXML()
- Specified by:
isXML
in interfacecom.funnelback.filter.api.DocumentType
-
withXML
public MockDocumentType withXML(boolean XML)
- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
isJSON
public boolean isJSON()
- Specified by:
isJSON
in interfacecom.funnelback.filter.api.DocumentType
-
withJSON
public MockDocumentType withJSON(boolean JSON)
- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withContentType
public MockDocumentType withContentType(String contentType)
- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
-