Package com.oorian.schema
Class SchemaOffer
java.lang.Object
com.oorian.schema.SchemaType
com.oorian.schema.SchemaOffer
- All Implemented Interfaces:
Jsonable
Represents a Schema.org Offer for pricing information.
An Offer represents a price or availability for a product or service. This is commonly used within SoftwareApplication, Product, or other commercial schema types.
Usage:
SchemaOffer offer = new SchemaOffer()
.setPrice(99)
.setPriceCurrency("USD")
.setAvailability("https://schema.org/InStock");
- Since:
- 2025
- Version:
- 1.0
- Author:
- Claude
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetAvailability(String availability) Sets the availability status of the offer.Sets the price of the offer.setPriceCurrency(String priceCurrency) Sets the currency of the price (ISO 4217 format).setPriceValidUntil(String priceValidUntil) Sets the date after which the price is no longer valid (ISO 8601 format).Sets the URL where the offer can be acquired.Serializes this object to aJsonValue.Methods inherited from class com.oorian.schema.SchemaType
createBaseJson, getType, initFromJsonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oorian.json.Jsonable
initFromJson, initFromJson, toJsonString
-
Constructor Details
-
SchemaOffer
public SchemaOffer()
-
-
Method Details
-
setPrice
Sets the price of the offer.- Parameters:
price- The numeric price value- Returns:
- This offer for method chaining
-
setPriceCurrency
Sets the currency of the price (ISO 4217 format).- Parameters:
priceCurrency- The currency code (e.g., "USD", "EUR", "GBP")- Returns:
- This offer for method chaining
-
setAvailability
Sets the availability status of the offer.- Parameters:
availability- The availability URL (e.g., "https://schema.org/InStock")- Returns:
- This offer for method chaining
-
setUrl
Sets the URL where the offer can be acquired.- Parameters:
url- The offer URL- Returns:
- This offer for method chaining
-
setPriceValidUntil
Sets the date after which the price is no longer valid (ISO 8601 format).- Parameters:
priceValidUntil- The expiration date (e.g., "2025-12-31")- Returns:
- This offer for method chaining
-
toJsonValue
Description copied from interface:JsonableSerializes this object to aJsonValue.- Specified by:
toJsonValuein interfaceJsonable- Specified by:
toJsonValuein classSchemaType- Returns:
- the JSON representation of this object.
-