public class Link extends Entity
Modifier and Type | Field and Description |
---|---|
static String |
KIND_IDENTIFIER_DEFAULT |
static URI |
SCHEME_DEFAULT |
static String |
SOURCE_ATTRIBUTE_NAME |
static String |
TARGET_ATTRIBUTE_NAME |
static String |
TERM_DEFAULT |
ID_ATTRIBUTE_NAME, TITLE_ATTRIBUTE_NAME
Constructor and Description |
---|
Link(String id,
Kind kind)
Constructor.
|
Link(String id,
Kind kind,
String title,
Model model)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static List<Attribute> |
getDefaultAttributes() |
static Kind |
getDefaultKind() |
String |
getDefaultKindIdentifier()
Returns link's default identifier 'http://schemas.ogf.org/occi/core#link'
|
String |
getRelation()
Returns link's relation.
|
String |
getSource()
Returns link's source (value of occi.core.source attribute).
|
String |
getTarget()
Returns link's target (value of occi.core.terget attribute).
|
void |
setRelation(String relation)
Sets link's relation.
|
void |
setSource(Resource source)
Sets link's source.
|
void |
setSource(String sourceLocation)
Sets link's source.
|
void |
setTarget(Resource target)
Sets link's target.
|
void |
setTarget(String targetLocation)
Sets link's target.
|
com.sun.net.httpserver.Headers |
toHeaders()
Returns an occi text representation of link instance as described in OCCI
standard in form of headers.
|
com.sun.net.httpserver.Headers |
toInlineHeaders()
Returns an inline occi text representation of link instance as described
in OCCI standard in form of headers.
|
String |
toInlineText()
Returns an inline plain text representation of link instance as described
in OCCI standard.
|
String |
toJSON()
Returns a JSON representation of link instance as described in OCCI
standard.
|
String |
toText()
Returns a plain text representation of link instance as described in OCCI
standard.
|
addAttribute, addAttributes, addMixin, addMixins, attributesToHeaders, attributesToOneLineText, attributesToPrefixText, clearAttributes, clearMixins, compareTo, containsAttribute, containsAttribute, containsMixin, containsMixin, equals, getAttributes, getId, getIdentifier, getKind, getMixin, getMixins, getModel, getTitle, getValue, getValue, hashCode, removeAttribute, removeMixin, setId, setKind, setModel, setTitle, toString
public static final String SOURCE_ATTRIBUTE_NAME
public static final String TARGET_ATTRIBUTE_NAME
public static final URI SCHEME_DEFAULT
public static final String TERM_DEFAULT
public static final String KIND_IDENTIFIER_DEFAULT
public Link(String id, Kind kind, String title, Model model) throws InvalidAttributeValueException
id
- occi.core.id attribute. Cannot be null.kind
- link's kind. Cannot be null.title
- occi.core.title attributemodel
- link's modelInvalidAttributeValueException
- in case of invalid id or title
valuepublic Link(String id, Kind kind) throws InvalidAttributeValueException
id
- occi.core.id attribute. Cannot be null.kind
- link's kind. Cannot be null.InvalidAttributeValueException
- in case of invalid id valuepublic String getSource()
public void setSource(Resource source) throws InvalidAttributeValueException
source
- link's source. Cannot be null.InvalidAttributeValueException
- in case source value is invalidpublic void setSource(String sourceLocation) throws InvalidAttributeValueException
sourceLocation
- location of link's sourceInvalidAttributeValueException
- in case source value is invalidpublic String getTarget()
public void setTarget(Resource target) throws InvalidAttributeValueException
target
- link's target. Cannot be null.InvalidAttributeValueException
- in case target value is invalidpublic void setTarget(String targetLocation) throws InvalidAttributeValueException
targetLocation
- location of link's targetInvalidAttributeValueException
- in case target value is invalidpublic String getRelation()
public void setRelation(String relation)
relation
- public String getDefaultKindIdentifier()
getDefaultKindIdentifier
in class Entity
public static Kind getDefaultKind()
public String toText()
public com.sun.net.httpserver.Headers toHeaders()
public String toInlineText() throws RenderingException
RenderingException
public com.sun.net.httpserver.Headers toInlineHeaders() throws RenderingException
RenderingException
Copyright © 2016. All Rights Reserved.