Class SchemaOffer

java.lang.Object
com.oorian.schema.SchemaType
com.oorian.schema.SchemaOffer
All Implemented Interfaces:
Jsonable

public class SchemaOffer extends SchemaType
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 Details

    • SchemaOffer

      public SchemaOffer()
  • Method Details

    • setPrice

      public SchemaOffer setPrice(Number price)
      Sets the price of the offer.
      Parameters:
      price - The numeric price value
      Returns:
      This offer for method chaining
    • setPriceCurrency

      public SchemaOffer setPriceCurrency(String priceCurrency)
      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

      public SchemaOffer setAvailability(String availability)
      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

      public SchemaOffer setUrl(String url)
      Sets the URL where the offer can be acquired.
      Parameters:
      url - The offer URL
      Returns:
      This offer for method chaining
    • setPriceValidUntil

      public SchemaOffer setPriceValidUntil(String priceValidUntil)
      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

      public JsonValue toJsonValue()
      Description copied from interface: Jsonable
      Serializes this object to a JsonValue.
      Specified by:
      toJsonValue in interface Jsonable
      Specified by:
      toJsonValue in class SchemaType
      Returns:
      the JSON representation of this object.