Spring Hateoas

org.springframework.hateoas
Class Resource<T>

java.lang.Object
  extended by org.springframework.hateoas.ResourceSupport
      extended by org.springframework.hateoas.Resource<T>
All Implemented Interfaces:
Identifiable<Link>

public class Resource<T>
extends ResourceSupport

A simple Resource wrapping a domain object and adding links to it.

Author:
Oliver Gierke

Constructor Summary
Resource(T content, Iterable<Link> links)
          Creates a new Resource with the given content and Links.
Resource(T content, Link... links)
          Creates a new Resource with the given content and Links (optional).
 
Method Summary
 boolean equals(Object obj)
           
 T getContent()
          Returns the underlying entity.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class org.springframework.hateoas.ResourceSupport
add, add, getId, getLink, getLinks, hasLink, hasLinks, removeLinks
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Resource

public Resource(T content,
                Link... links)
Creates a new Resource with the given content and Links (optional).

Parameters:
content - must not be null.
links - the links to add to the Resource.

Resource

public Resource(T content,
                Iterable<Link> links)
Creates a new Resource with the given content and Links.

Parameters:
content - must not be null.
links - the links to add to the Resource.
Method Detail

getContent

public T getContent()
Returns the underlying entity.

Returns:
the content

toString

public String toString()
Overrides:
toString in class ResourceSupport

equals

public boolean equals(Object obj)
Overrides:
equals in class ResourceSupport

hashCode

public int hashCode()
Overrides:
hashCode in class ResourceSupport

Spring Hateoas

Copyright © 2012-2014-2014 Pivotal, Inc.. All Rights Reserved.