All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.payu.sdk.api.model.termsconditions.Link Maven / Gradle / Ivy

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
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy