Spring Hateoas

org.springframework.hateoas
Interface LinkBuilder

All Known Implementing Classes:
BasicLinkBuilder, ControllerLinkBuilder, JaxRsLinkBuilder, LinkBuilderSupport

public interface LinkBuilder

Builder to ease building Link instances.

Author:
Ricardo Gladwell

Method Summary
 LinkBuilder slash(Identifiable<?> identifiable)
          Adds the given Identifiable's id as sub-resource.
 LinkBuilder slash(Object object)
          Adds the given object's String representation as sub-resource to the current URI.
 URI toUri()
          Creates a URI of the link built by the current builder instance.
 Link withRel(String rel)
          Creates the Link built by the current builder instance with the given rel.
 Link withSelfRel()
          Creates the Link built by the current builder instance with the default self rel.
 

Method Detail

slash

LinkBuilder slash(Object object)
Adds the given object's String representation as sub-resource to the current URI. Will unwrap Identifiables to their id value (see Identifiable.getId()).

Parameters:
object -
Returns:

slash

LinkBuilder slash(Identifiable<?> identifiable)
Adds the given Identifiable's id as sub-resource. Will simply return the LinkBuilder as is if the given entity is null.

Parameters:
identifiable -
Returns:

toUri

URI toUri()
Creates a URI of the link built by the current builder instance.

Returns:

withRel

Link withRel(String rel)
Creates the Link built by the current builder instance with the given rel.

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

withSelfRel

Link withSelfRel()
Creates the Link built by the current builder instance with the default self rel.

Returns:
See Also:
Link.REL_SELF

Spring Hateoas

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