org.jclouds.openstack.domain
Class Link

java.lang.Object
  extended by org.jclouds.openstack.domain.Link

public class Link
extends Object

For convenience, resources contain links to themselves. This allows a client to easily obtain a resource URIs rather than to construct them.

Author:
AdrianCole
See Also:

Nested Class Summary
static class Link.Builder
           
static class Link.Relation
          Relations associated with resources.
 
Field Summary
protected  URI href
           
protected  Link.Relation relation
           
protected  String type
           
 
Constructor Summary
protected Link(Link.Relation relation, String type, URI href)
           
 
Method Summary
static Link.Builder builder()
           
static Link create(Link.Relation relation, String type, URI href)
           
static Link create(Link.Relation relation, URI href)
           
 boolean equals(Object object)
           
 URI getHref()
           
 Link.Relation getRelation()
          There are three kinds of link relations associated with resources.
 String getType()
           
 int hashCode()
           
 Link.Builder toBuilder()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

relation

@Named(value="rel")
protected Link.Relation relation

type

protected String type

href

protected URI href
Constructor Detail

Link

@ConstructorProperties(value={"rel","type","href"})
protected Link(Link.Relation relation,
                                          @Nullable
                                          String type,
                                          URI href)
Method Detail

create

public static Link create(Link.Relation relation,
                          URI href)

create

public static Link create(Link.Relation relation,
                          String type,
                          URI href)

builder

public static Link.Builder builder()

toBuilder

public Link.Builder toBuilder()

getRelation

public Link.Relation getRelation()
There are three kinds of link relations associated with resources. A self link contains a versioned link to the resource. These links should be used in cases where the link will be followed immediately. A bookmark link provides a permanent link to a resource that is appropriate for long term storage. An alternate link can contain an alternate representation of the resource. For example, an OpenStack Compute image may have an alternate representation in the OpenStack Image service. Note that the type attribute here is used to provide a hint as to the type of representation to expect when following the link.

Returns:
the relation of the resource in the current OpenStack deployment

getType

@Nullable
public String getType()
Returns:
the type of the resource or null if not specified

getHref

public URI getHref()
Returns:
the href of the resource

equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012 jclouds. All Rights Reserved.