共用方式為


Offer Class

public class Offer
extends Resource

Represents the offer for a resource in the Azure Cosmos DB database service.

Constructor Summary

Constructor Description
Offer()

Initialize an offer object.

Offer(Offer otherOffer)

Initialize an offer object and copy all properties from the other offer.

Offer(String jsonString)

Initialize an offer object from json string.

Offer(JSONObject jsonObject)

Initialize an offer object from json object.

Method Summary

Modifier and Type Method and Description
org.json.JSONObject getContent()

Gets the content object that contains the details of the offer.

java.lang.String getOfferResourceId()

Sets the target resource id of a resource to which this offer applies.

java.lang.String getOfferType()

Gets the OfferType for the resource offer.

java.lang.String getOfferVersion()

Gets the version of the current offer.

java.lang.String getResourceLink()

Gets the self-link of a resource to which the resource offer applies.

void setContent(JSONObject offerContent)

Sets the offer content that contains the details of the offer.

void setOfferType(String offerType)

Sets the OfferType for the resource offer.

void setOfferVersion(String offerVersion)

Sets the offer version.

Methods inherited from JsonSerializable

Methods inherited from Resource

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

Offer

public Offer()

Initialize an offer object.

Offer

public Offer(Offer otherOffer)

Initialize an offer object and copy all properties from the other offer.

Parameters:

otherOffer - the Offer object whose properties to copy over.

Offer

public Offer(String jsonString)

Initialize an offer object from json string.

Parameters:

jsonString - the json string that represents the offer.

Offer

public Offer(JSONObject jsonObject)

Initialize an offer object from json object.

Parameters:

jsonObject - the json object that represents the offer.

Method Details

getContent

public JSONObject getContent()

Gets the content object that contains the details of the offer.

Returns:

the offer content.

getOfferResourceId

public String getOfferResourceId()

Sets the target resource id of a resource to which this offer applies.

Returns:

the resource id.

getOfferType

public String getOfferType()

Gets the OfferType for the resource offer.

Returns:

the offer type.

getOfferVersion

public String getOfferVersion()

Gets the version of the current offer.

Returns:

the offer version.

getResourceLink

public String getResourceLink()

Gets the self-link of a resource to which the resource offer applies.

Returns:

the resource link.

setContent

public void setContent(JSONObject offerContent)

Sets the offer content that contains the details of the offer.

Parameters:

offerContent - the content object.

setOfferType

public void setOfferType(String offerType)

Sets the OfferType for the resource offer.

Parameters:

offerType - the offer type.

setOfferVersion

public void setOfferVersion(String offerVersion)

Sets the offer version.

Parameters:

offerVersion - the version of the offer.

Applies to