Merge "Fix build errors in autorelease full clean build"
[vfc/nfvo/wfengine.git] / winery / org.eclipse.winery.repository / src / main / java / org / eclipse / winery / repository / resources / entitytypes / requirementtypes / RequirementTypeResource.java
1 /*******************************************************************************
2  * Copyright (c) 2012-2013 University of Stuttgart.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * and the Apache License 2.0 which both accompany this distribution,
6  * and are available at http://www.eclipse.org/legal/epl-v10.html
7  * and http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Contributors:
10  *     Oliver Kopp - initial API and implementation
11  *******************************************************************************/
12 package org.eclipse.winery.repository.resources.entitytypes.requirementtypes;
13
14 import javax.ws.rs.Path;
15
16 import org.eclipse.winery.model.tosca.TExtensibleElements;
17 import org.eclipse.winery.model.tosca.TRequirementType;
18 import org.eclipse.winery.common.ids.definitions.RequirementTypeId;
19 import org.eclipse.winery.repository.resources.EntityTypeResource;
20
21 public class RequirementTypeResource extends EntityTypeResource {
22         
23         public RequirementTypeResource(RequirementTypeId id) {
24                 super(id);
25         }
26         
27         /**
28          * Convenience method to avoid casting at the caller's side.
29          */
30         public TRequirementType getRequirementType() {
31                 return (TRequirementType) this.getElement();
32         }
33         
34         @Override
35         protected TExtensibleElements createNewElement() {
36                 return new TRequirementType();
37         }
38         
39         @Path("requiredcapabilitytype/")
40         public RequiredCapabilityTypeResource getRequiredCapabilityTypeResource() {
41                 return new RequiredCapabilityTypeResource(this);
42         }
43         
44 }