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

org.continuity.api.rest.PathPar Maven / Gradle / Ivy

The newest version!
package org.continuity.api.rest;

/**
 * Represents a path variable, e.g., {id} in /my/path/{id}.
 *
 * @author Henning Schulz
 *
 */
public class PathPar {

	private final String name;

	private PathPar(String name) {
		this.name = name;
	}

	/**
	 * Creates a new instance.
	 *
	 * @param name
	 *            The name of the parameter.
	 * @return The instance.
	 */
	public static PathPar of(String name) {
		return new PathPar(name);
	}

	/**
	 * Returns a string representation of this parameter for usage in a generic path, e.g.,
	 * /my/path/{id}..
	 *
	 * @return {parameter-name}
	 */
	public String generic() {
		return "{" + name + "}";
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy