org.jclouds.googlecomputeengine.domain
Class Resource

java.lang.Object
  extended by org.jclouds.googlecomputeengine.domain.Resource
Direct Known Subclasses:
AbstractDisk, Address, Firewall, Image, Instance, MachineType, Network, Operation, Project, Region, Route, Zone

@Beta
public class Resource
extends Object

Base class for Google Compute Engine resources.

Author:
David Alves

Nested Class Summary
static class Resource.Builder<T extends Resource.Builder<T>>
           
static class Resource.Kind
           
 
Field Summary
protected  com.google.common.base.Optional<Date> creationTimestamp
           
protected  com.google.common.base.Optional<String> description
           
protected  String id
           
protected  Resource.Kind kind
           
protected  String name
           
protected  URI selfLink
           
 
Constructor Summary
protected Resource(Resource.Kind kind, String id, Date creationTimestamp, URI selfLink, String name, String description)
           
 
Method Summary
static Resource.Builder<?> builder()
           
 boolean equals(Object obj)
          
 com.google.common.base.Optional<Date> getCreationTimestamp()
           
 com.google.common.base.Optional<String> getDescription()
           
 String getId()
           
 Resource.Kind getKind()
           
 String getName()
           
 URI getSelfLink()
           
 int hashCode()
          
protected  com.google.common.base.Objects.ToStringHelper string()
          
 Resource.Builder<?> toBuilder()
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

kind

protected final Resource.Kind kind

id

protected final String id

creationTimestamp

protected final com.google.common.base.Optional<Date> creationTimestamp

selfLink

protected final URI selfLink

name

protected final String name

description

protected final com.google.common.base.Optional<String> description
Constructor Detail

Resource

@ConstructorProperties(value={"kind","id","creationTimestamp","selfLink","name","description"})
protected Resource(Resource.Kind kind,
                                              String id,
                                              Date creationTimestamp,
                                              URI selfLink,
                                              String name,
                                              String description)
Method Detail

getKind

public Resource.Kind getKind()
Returns:
the Type of the resource

getId

public String getId()
Returns:
unique identifier for the resource; defined by the server.

getCreationTimestamp

public com.google.common.base.Optional<Date> getCreationTimestamp()
Returns:
creation timestamp in RFC3339 text format.

getSelfLink

public URI getSelfLink()
Returns:
server defined URL for the resource.

getName

public String getName()
Returns:
name of the resource.

getDescription

@Nullable
public com.google.common.base.Optional<String> getDescription()
Returns:
an optional textual description of the resource.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

string

protected com.google.common.base.Objects.ToStringHelper string()


toString

public String toString()

Overrides:
toString in class Object

builder

public static Resource.Builder<?> builder()

toBuilder

public Resource.Builder<?> toBuilder()


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.