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

com.sappenin.utils.rest.v2.model.Link Maven / Gradle / Ivy

Go to download

Utilities, Helpers, and base-classes for assisting in server-side REST API implementations written in Java.

The newest version!
package com.sappenin.utils.rest.v2.model;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.squareup.okhttp.HttpUrl;

/**
 * A link to another resource, possibly with a type.
 */
@Getter
@EqualsAndHashCode
@ToString
public class Link
{
	// Must be a URL so that it's can be both unique and de-referencable.
	@JsonProperty("href")
	private final HttpUrl hrefUrl;

	/**
	 * Required Args Constructor.
	 * 
	 * @param hrefUrl A {@link HttpUrl} that can identify and locate a resource.
	 */
	public Link(@JsonProperty("href") final HttpUrl hrefUrl)
	{
		this.hrefUrl = hrefUrl;
	}

	/**
	 * A builder for a {@link Link}.
	 *
	 * @param hrefUrl
	 * @return
	 */
	public static Link build(final HttpUrl hrefUrl)
	{
		return new Link(hrefUrl);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy