Interface Item

All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject

public interface Item extends OsidObject

An Item is a product or service.

  • Method Details

    • getCategoryId

      Id getCategoryId()
      Gets the category Id .
      Returns:
      the category Id
      Compliance:
      mandatory - This method is must be implemented.
    • getCategory

      Category getCategory() throws OperationFailedException
      Gets the item category.
      Returns:
      the category
      Throws:
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • hasAccount

      boolean hasAccount()
      Tests if this item relates to s specific general ledger account.
      Returns:
      true if this item has an account, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getAccountId

      Id getAccountId()
      Gets the account Id .
      Returns:
      the account Id
      Throws:
      IllegalStateException - hasAccount() is false
      Compliance:
      mandatory - This method is must be implemented.
    • getAccount

      Account getAccount() throws OperationFailedException
      Gets the item account.
      Returns:
      the account
      Throws:
      IllegalStateException - hasAccount() is false
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • hasProduct

      boolean hasProduct()
      Tests if this item relates to s specific product.
      Returns:
      true if this item has a product, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getProductId

      Id getProductId()
      Gets the product Id .
      Returns:
      the product Id
      Throws:
      IllegalStateException - hasProduct() is false
      Compliance:
      mandatory - This method is must be implemented.
    • getProduct

      Product getProduct() throws OperationFailedException
      Gets the product.
      Returns:
      the product
      Throws:
      IllegalStateException - hasProduct() is false
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAmount

      Currency getAmount()
      Gets the amount of this item.
      Returns:
      the amount
      Compliance:
      mandatory - This method must be implemented.
    • isDebit

      boolean isDebit()
      Tests if the amount is a debit or a credit.
      Returns:
      true if this item amount is a debit, false if it is a credit
      Compliance:
      mandatory - This method must be implemented.
    • isRecurring

      boolean isRecurring()
      Tests if this item is a recurring charge.
      Returns:
      true if this item is recurring, false if one-time
      Compliance:
      mandatory - This method must be implemented.
    • getRecurringInterval

      Duration getRecurringInterval()
      Gets the recurring interval.
      Returns:
      the interval
      Throws:
      IllegalStateException - isRecurring() is false
      Compliance:
      mandatory - This method must be implemented.
    • getItemRecord

      ItemRecord getItemRecord(Type itemRecordType) throws OperationFailedException
      Gets the item record corresponding to the given Item record Type .This method is used to retrieve an object implementing the requested record. The itemRecordType may be the Type returned in getRecordTypes() or any of its parents in a Type hierarchy where hasRecordType(itemRecordType) is true .
      Parameters:
      itemRecordType - the type of item record to retrieve
      Returns:
      the item record
      Throws:
      NullArgumentException - itemRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(itemRecordType) is false
      Compliance:
      mandatory - This method must be implemented.