Class 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 interface DocumentType doesn't already exist. Example creating a DocumentType that claims to be HTML with a specific value for what is returned by DocumentType.asContentType(). new MockDocumentType().withHTML(true).withContentType("something/specific");
    • 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 interface com.funnelback.filter.api.DocumentType
      • 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 interface com.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 interface com.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 interface com.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).