Class Resource


  • @Immutable
    public class Resource
    extends java.lang.Object
    Resource with optional associated content type.
    • Constructor Summary

      Constructors 
      Constructor Description
      Resource​(java.lang.String content, java.lang.String contentType)
      Creates a new resource with optional associated content type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContent()
      Gets the content of this resource.
      java.lang.String getContentType()
      Gets the content type of this resource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Resource

        public Resource​(java.lang.String content,
                        java.lang.String contentType)
        Creates a new resource with optional associated content type.
        Parameters:
        content - The resource content, empty string if none. Must not be null.
        contentType - The resource content type, null if not specified.
    • Method Detail

      • getContent

        public java.lang.String getContent()
        Gets the content of this resource.
        Returns:
        The content, empty string if none.
      • getContentType

        public java.lang.String getContentType()
        Gets the content type of this resource.
        Returns:
        The content type, null if not specified.