Class Purchase


  • public class Purchase
    extends Object
    Purchase
    • Constructor Detail

      • Purchase

        public Purchase()
    • Method Detail

      • date

        public Purchase date​(OffsetDateTime date)
        The time of the purchase.
        Parameters:
        date -
        Returns:
        the current Purchase instance, allowing for method chaining
      • getDate

        public OffsetDateTime getDate()
        The time of the purchase.
        Returns:
        date
      • setDate

        public void setDate​(OffsetDateTime date)
        The time of the purchase.
        Parameters:
        date -
      • merchantName

        public Purchase merchantName​(String merchantName)
        The name of the merchant.
        Parameters:
        merchantName -
        Returns:
        the current Purchase instance, allowing for method chaining
      • getMerchantName

        public String getMerchantName()
        The name of the merchant.
        Returns:
        merchantName
      • setMerchantName

        public void setMerchantName​(String merchantName)
        The name of the merchant.
        Parameters:
        merchantName -
      • originalAmount

        public Purchase originalAmount​(Amount originalAmount)
        originalAmount
        Parameters:
        originalAmount -
        Returns:
        the current Purchase instance, allowing for method chaining
      • getOriginalAmount

        public Amount getOriginalAmount()
        Get originalAmount
        Returns:
        originalAmount
      • setOriginalAmount

        public void setOriginalAmount​(Amount originalAmount)
        originalAmount
        Parameters:
        originalAmount -
      • equals

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

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

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

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