Partager via


Resource Class

public class Resource
extends JsonSerializable

Represents the base resource in the Azure Cosmos DB database service.

Constructor Summary

Modifier Constructor Description
protected Resource()

Constructor.

protected Resource(String jsonString)

Constructor.

protected Resource(String jsonString, ObjectMapper objectMapper)

Constructor.

protected Resource(JSONObject jsonObject)

Constructor.

Method Summary

Modifier and Type Method and Description
java.lang.String getETag()

Get the entity tag associated with the resource.

java.lang.String getId()

Gets the name of the resource.

java.lang.String getResourceId()

Gets the ID associated with the resource.

java.lang.String getSelfLink()

Get the self-link associated with the resource.

java.util.Date getTimestamp()

Get the last modified timestamp associated with the resource.

void setId(String id)

Sets the name of the resource.

void setResourceId(String resourceId)

Set the ID associated with the resource.

Methods inherited from JsonSerializable

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

Resource

protected Resource()

Constructor.

Resource

protected Resource(String jsonString)

Constructor.

Parameters:

jsonString - the json string that represents the resource.

Resource

protected Resource(String jsonString, ObjectMapper objectMapper)

Constructor.

Parameters:

jsonString - the json string that represents the resource.
objectMapper - the custom object mapper

Resource

protected Resource(JSONObject jsonObject)

Constructor.

Parameters:

jsonObject - the json object that represents the resource.

Method Details

getETag

public String getETag()

Get the entity tag associated with the resource.

Returns:

the e tag.

getId

public String getId()

Gets the name of the resource.

Returns:

the name of the resource.

getResourceId

public String getResourceId()

Gets the ID associated with the resource.

Returns:

the ID associated with the resource.

getSelfLink

public String getSelfLink()

Get the self-link associated with the resource.

Returns:

the self link.

getTimestamp

public Date getTimestamp()

Get the last modified timestamp associated with the resource.

Returns:

the timestamp.

setId

public void setId(String id)

Sets the name of the resource.

Parameters:

id - the name of the resource.

setResourceId

public void setResourceId(String resourceId)

Set the ID associated with the resource.

Parameters:

resourceId - the ID associated with the resource.

Applies to