Spring Hateoas

org.springframework.hateoas
Class Link

java.lang.Object
  extended by org.springframework.hateoas.Link
All Implemented Interfaces:
Serializable

public class Link
extends Object
implements Serializable

Value object for links.

Author:
Oliver Gierke
See Also:
Serialized Form

Field Summary
static String ATOM_NAMESPACE
           
static String REL_FIRST
           
static String REL_LAST
           
static String REL_NEXT
           
static String REL_PREVIOUS
           
static String REL_SELF
           
 
Constructor Summary
protected Link()
          Empty constructor required by the marshalling framework.
  Link(String href)
          Creates a new link to the given URI with the self rel.
  Link(String href, String rel)
          Creates a new Link to the given URI with the given rel.
 
Method Summary
 boolean equals(Object obj)
           
 String getHref()
          Returns the actual URI the link is pointing to.
 String getRel()
          Returns the rel of the link.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATOM_NAMESPACE

public static final String ATOM_NAMESPACE
See Also:
Constant Field Values

REL_SELF

public static final String REL_SELF
See Also:
Constant Field Values

REL_FIRST

public static final String REL_FIRST
See Also:
Constant Field Values

REL_PREVIOUS

public static final String REL_PREVIOUS
See Also:
Constant Field Values

REL_NEXT

public static final String REL_NEXT
See Also:
Constant Field Values

REL_LAST

public static final String REL_LAST
See Also:
Constant Field Values
Constructor Detail

Link

public Link(String href)
Creates a new link to the given URI with the self rel.

Parameters:
href - must not be null or empty.
See Also:
REL_SELF

Link

public Link(String href,
            String rel)
Creates a new Link to the given URI with the given rel.

Parameters:
href - must not be null or empty.
rel - must not be null or empty.

Link

protected Link()
Empty constructor required by the marshalling framework.

Method Detail

getHref

public String getHref()
Returns the actual URI the link is pointing to.

Returns:

getRel

public String getRel()
Returns the rel of the link.

Returns:

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Spring Hateoas

Copyright © 2012 SpringSource, a division of VMware. All Rights Reserved.