org.springframework.hateoas
Class Resource<T>
java.lang.Object
org.springframework.hateoas.ResourceSupport
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
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.
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
Copyright © 2012-2014–2014 Pivotal, Inc.. All rights reserved.