Class HalResource<T extends HalResource<?>>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​java.lang.Object> _embedded
      Embedded resources
      protected java.util.Map<java.lang.String,​HalLink> _links
      This resource links
      protected HalLinker linker  
    • Constructor Summary

      Constructors 
      Constructor Description
      HalResource()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEmbedded​(java.lang.String name, java.util.List<HalResource<?>> embeddedCollection)  
      void addEmbedded​(java.lang.String name, HalResource<?> embedded)  
      void addLink​(java.lang.String rel, java.lang.String href)  
      void addLink​(java.lang.String rel, java.net.URI hrefUri)  
      T embed​(HalRelation relation, ProcessEngine processEngine)
      Can be used to embed a relation.
      java.util.Map<java.lang.String,​java.lang.Object> get_embedded()  
      java.util.Map<java.lang.String,​HalLink> get_links()  
      java.lang.Object getEmbedded​(java.lang.String name)  
      • Methods inherited from class java.lang.Object

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

      • _links

        protected java.util.Map<java.lang.String,​HalLink> _links
        This resource links
      • _embedded

        protected java.util.Map<java.lang.String,​java.lang.Object> _embedded
        Embedded resources
      • linker

        protected transient HalLinker linker
    • Constructor Detail

      • HalResource

        public HalResource()
    • Method Detail

      • get_links

        public java.util.Map<java.lang.String,​HalLink> get_links()
      • get_embedded

        public java.util.Map<java.lang.String,​java.lang.Object> get_embedded()
      • addLink

        public void addLink​(java.lang.String rel,
                            java.lang.String href)
      • addLink

        public void addLink​(java.lang.String rel,
                            java.net.URI hrefUri)
      • addEmbedded

        public void addEmbedded​(java.lang.String name,
                                HalResource<?> embedded)
      • addEmbedded

        public void addEmbedded​(java.lang.String name,
                                java.util.List<HalResource<?>> embeddedCollection)
      • getEmbedded

        public java.lang.Object getEmbedded​(java.lang.String name)
      • embed

        public T embed​(HalRelation relation,
                       ProcessEngine processEngine)
        Can be used to embed a relation. Embedded all linked resources in the given relation.
        Parameters:
        relation - the relation to embedded
        processEngine - used to resolve the resources
        Returns:
        the resource itself.