summaryrefslogtreecommitdiffstats
path: root/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/resources/IHasName.java
blob: 08a3696ccd57db64167b3e31860f1ac2971f9c18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*******************************************************************************
 * Copyright (c) 2012-2013 University of Stuttgart.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and the Apache License 2.0 which both accompany this distribution,
 * and are available at http://www.eclipse.org/legal/epl-v10.html
 * and http://www.apache.org/licenses/LICENSE-2.0
 *
 * Contributors:
 *     Oliver Kopp - initial API and implementation
 *******************************************************************************/
package org.eclipse.winery.repository.resources;

import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.restdoc.annotations.RestDoc;

/**
 * Ensures that the AbstractComponentInstance has a getName method
 */
public interface IHasName {
	
	@GET
	@Path("name")
	// @formatter:off
	@RestDoc(methodDescription = "Returns the name of the element. " +
	"Defaults to the ID of the element. " +
	"Some other ComponentInstances either carry a name or an ID. ")
	// @formatter:on
	@Produces(MediaType.TEXT_PLAIN)
	public String getName();
	
	@PUT
	@Path("name")
	public Response setName(@FormParam("value") String name);
	
}