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

com.github.jasminb.jsonapi.Link Maven / Gradle / Ivy

Go to download

JSONAPI-Converter is a library that provides means for integrating with services using JSON API specification.

There is a newer version: 0.14
Show newest version
package com.github.jasminb.jsonapi;

import java.io.Serializable;
import java.util.Map;

/**
 * Models a JSON API Link object.
 */
public class Link implements Serializable {
	private static final long serialVersionUID = -6509249812347545112L;
	
	private String href;
	private Map meta;
	
	/**
	 * Creates new Link.
	 */
	public Link() {
		// Empty CTOR
	}
	
	/**
	 * Creates new Link.
	 *
	 * @param href {@link String} link value
	 */
	public Link(String href) {
		this.href = href;
	}
	
	/**
	 * Creates new Link.
	 *
	 * @param href {@link String} link value
	 * @param meta {@link Map} link meta
	 */
	public Link(String href, Map meta) {
		this.href = href;
		this.meta = meta;
	}
	
	/**
	 * Gets href.
	 *
	 * @return the href
	 */
	public String getHref() {
		return href;
	}
	
	/**
	 * Sets href.
	 *
	 * @param href the href
	 */
	public void setHref(String href) {
		this.href = href;
	}
	
	/**
	 * Gets meta.
	 *
	 * @return the meta
	 */
	public Map getMeta() {
		return meta;
	}
	
	/**
	 * Sets meta.
	 *
	 * @param meta the meta
	 */
	public void setMeta(Map meta) {
		this.meta = meta;
	}
	
	@Override
	public String toString() {
		return String.valueOf(getHref());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy