
org.xlcloud.service.Referenceable Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2012 AMG.lab, a Bull Group Company
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.xlcloud.service;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import org.xlcloud.service.model.stack.Event;
/**
* Referenceable object abstraction. Any entity that can be referenced by an
* identifier or URI should extend this type
*
*
*
* Java class for Referenceable complex type.
*
*
* The following schema fragment specifies the expected content contained within
* this class.
*
*
* <complexType name="Referenceable">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}long" />
* <attribute name="href" type="{http://bull.com/xlcloud/vcms}href" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType( XmlAccessType.PROPERTY)
// AccessorType has to be 'PROPERTY'. FIELD accessor won't set href properly.
@XmlType( name = "Referenceable")
@XmlSeeAlso({
Group.class,
Parameterizable.class,
Account.class,
AccessToken.class,
User.class,
Project.class,
Event.class
})
public abstract class Referenceable implements Serializable {
/**
* TODO Documentation serialVersionUID
*/
private static final long serialVersionUID = -7532617922888271125L;
protected Long id;
protected String href;
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link Long }
*
*/
@XmlAttribute
public Long getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setId(Long value) {
this.id = value;
}
/**
* Gets the value of the href property.
*
* @return
* possible object is
* {@link String }
*
*/
@XmlAttribute
public String getHref() {
return id != null ? this.getResourcePrefix() + "/" + this.getId() : null;
}
protected abstract String getResourcePrefix();
/**
* Sets the value of the href property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setHref(String value) {
this.href = value;
}
@Override
public String toString() {
return "[" + this.getClass().getSimpleName() + ":" + this.getId() + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy