Example usage for org.springframework.hateoas Link Link

List of usage examples for org.springframework.hateoas Link Link

Introduction

In this page you can find the example usage for org.springframework.hateoas Link Link.

Prototype

private Link(UriTemplate template, LinkRelation rel, List<Affordance> affordances) 

Source Link

Document

Creates a new Link from the given UriTemplate , link relation and affordances.

Usage

From source file:org.springframework.hateoas.Link.java

/**
 * Returns a {@link Link} pointing to the same URI but with the given relation.
 *
 * @param rel must not be {@literal null} or empty.
 * @return// ww  w .ja  v a2s.  c o m
 */
public Link withRel(String rel) {
    if (profile != null) {
        return new Link(href, rel, profile);
    }
    return new Link(href, rel);
}

From source file:org.springframework.hateoas.Link.java

/**
 * Returns a {@link Link} pointing to the same URI but with the given profile.
 *
 * @param rel must not be {@literal null} or empty.
 * @return/*  w  w  w  .  j  av  a2 s.c om*/
 */
public Link withProfile(String profile) {
    return new Link(href, rel, profile);
}