Class LinkedResource


  • public final class LinkedResource
    extends java.lang.Object
    Represents a linked resource in a Package Document, i.e. a resource referenced from a link element (either at the package level or in collections).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private com.google.common.base.Optional<java.lang.String> id  
      private com.google.common.base.Optional<java.lang.String> mimetype  
      private com.google.common.base.Optional<java.lang.String> refines  
      private java.util.Set<Property> rel  
      private io.mola.galimatias.URL url  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.mola.galimatias.URL getDocumentURL()
      Returns the URL of the linked resource document, i.e.
      com.google.common.base.Optional<java.lang.String> getId()
      Returns an Optional containing the value of the ID of the link , or Optional.absent() if the element has no ID.
      com.google.common.base.Optional<java.lang.String> getMimeType()
      Returns an Optional containing the declared media type of this resource as specified in the media-type attribute, or Optional.absent() if the media type is not declared.
      com.google.common.base.Optional<java.lang.String> getRefines()
      Returns an Optional containing the value of the refines attribute of the link , or Optional.absent() if the element has no such attribute.
      java.util.Set<Property> getRel()
      Returns the set of properties defining the nature of the resource, as defined in the rel attribute.
      io.mola.galimatias.URL getURL()
      Returns the URL of the linked resource as defined in the href attribute of the link element.
      private static com.google.common.base.Optional<java.lang.String> optional​(java.lang.String string)  
      • Methods inherited from class java.lang.Object

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

      • id

        private final com.google.common.base.Optional<java.lang.String> id
      • url

        private final io.mola.galimatias.URL url
      • rel

        private final java.util.Set<Property> rel
      • refines

        private final com.google.common.base.Optional<java.lang.String> refines
      • mimetype

        private final com.google.common.base.Optional<java.lang.String> mimetype
    • Method Detail

      • getId

        public com.google.common.base.Optional<java.lang.String> getId()
        Returns an Optional containing the value of the ID of the link , or Optional.absent() if the element has no ID.
      • getURL

        public io.mola.galimatias.URL getURL()
        Returns the URL of the linked resource as defined in the href attribute of the link element. Guaranteed non-null.
      • getDocumentURL

        public io.mola.galimatias.URL getDocumentURL()
        Returns the URL of the linked resource document, i.e. the linked URL minus a possible fragment. Guaranteed non-null.
      • getRel

        public java.util.Set<Property> getRel()
        Returns the set of properties defining the nature of the resource, as defined in the rel attribute.
        Returns:
        the set of rel properties (may be empty for collection resources). Guaranteed non-null.
      • getRefines

        public com.google.common.base.Optional<java.lang.String> getRefines()
        Returns an Optional containing the value of the refines attribute of the link , or Optional.absent() if the element has no such attribute.
      • getMimeType

        public com.google.common.base.Optional<java.lang.String> getMimeType()
        Returns an Optional containing the declared media type of this resource as specified in the media-type attribute, or Optional.absent() if the media type is not declared.
      • optional

        private static com.google.common.base.Optional<java.lang.String> optional​(java.lang.String string)