Class OrderItem


  • public class OrderItem
    extends Object
    OrderItem
    • Constructor Detail

      • OrderItem

        public OrderItem()
    • Method Detail

      • getId

        public String getId()
        The unique identifier of the product.
        Returns:
        id
      • setId

        public void setId​(String id)
        The unique identifier of the product.
        Parameters:
        id -
      • installments

        public OrderItem installments​(Long installments)
      • getInstallments

        public Long getInstallments()
        The number of installments for the specified product `id`.
        Returns:
        installments
      • setInstallments

        public void setInstallments​(Long installments)
        The number of installments for the specified product `id`.
        Parameters:
        installments -
      • getName

        public String getName()
        The name of the product.
        Returns:
        name
      • setName

        public void setName​(String name)
        The name of the product.
        Parameters:
        name -
      • getQuantity

        public Integer getQuantity()
        The number of items with the specified product `id` included in the order.
        Returns:
        quantity
      • setQuantity

        public void setQuantity​(Integer quantity)
        The number of items with the specified product `id` included in the order.
        Parameters:
        quantity -
      • equals

        public boolean equals​(Object o)
        Return true if this OrderItem object is equal to o.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • fromJson

        public static OrderItem fromJson​(String jsonString)
                                  throws com.fasterxml.jackson.core.JsonProcessingException
        Create an instance of OrderItem given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of OrderItem
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if the JSON string is invalid with respect to OrderItem
      • toJson

        public String toJson()
                      throws com.fasterxml.jackson.core.JsonProcessingException
        Convert an instance of OrderItem to an JSON string
        Returns:
        JSON string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException