com.payu.sdk.api.model.termsconditions.Link Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-client Show documentation
Show all versions of api-client Show documentation
A fresh implementation of the PayU API Client for Android
The newest version!
package com.payu.sdk.api.model.termsconditions;
public class Link {
private String href;
private Rel rel;
public Link(String href) {
this(href, Rel.self);
}
public Link(String href, Rel rel) {
this.href = href;
this.rel = rel;
}
protected Link() {
}
public String getHref() {
return href;
}
public Rel getRel() {
return rel;
}
/**
* Returns a {@link Link} pointing to the same URI but with the given relation.
*
* @param rel must not be {@literal null} or empty.
* @return the Link
*/
public Link withRel(Rel rel) {
return new Link(href, rel);
}
/**
* Returns a {@link Link} pointing to the same URI but with the {@code self} relation.
*/
public Link withSelfRel() {
return withRel(Link.Rel.self);
}
/**
* The link relationships
*/
public static enum Rel {
self, first, prev, next, last
}
}