Price.java

  1. //
  2. // This file was generated by the Eclipse Implementation of JAXB, v2.3.7
  3. // See https://eclipse-ee4j.github.io/jaxb-ri
  4. // Any modifications to this file will be lost upon recompilation of the source schema.
  5. // Generated on: 2025.03.29 at 03:53:25 AM UTC
  6. //


  7. package com.googlecode.phisix.api.model;

  8. import java.io.Serializable;
  9. import java.math.BigDecimal;
  10. import javax.xml.bind.annotation.XmlAccessType;
  11. import javax.xml.bind.annotation.XmlAccessorType;
  12. import javax.xml.bind.annotation.XmlElement;
  13. import javax.xml.bind.annotation.XmlType;
  14. import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
  15. import org.jvnet.jaxb2_commons.lang.Equals2;
  16. import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
  17. import org.jvnet.jaxb2_commons.lang.HashCode2;
  18. import org.jvnet.jaxb2_commons.lang.HashCodeStrategy2;
  19. import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
  20. import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
  21. import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
  22. import org.jvnet.jaxb2_commons.lang.ToString2;
  23. import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
  24. import org.jvnet.jaxb2_commons.locator.ObjectLocator;
  25. import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;


  26. /**
  27.  * <p>Java class for Price complex type.
  28.  *
  29.  * <p>The following schema fragment specifies the expected content contained within this class.
  30.  *
  31.  * <pre>
  32.  * &lt;complexType name="Price"&gt;
  33.  *   &lt;complexContent&gt;
  34.  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
  35.  *       &lt;sequence&gt;
  36.  *         &lt;element name="currency" type="{http://phisix-api.appspot.com/phisix-stocks}CurrencyCode"/&gt;
  37.  *         &lt;element name="amount" type="{http://www.w3.org/2001/XMLSchema}decimal"/&gt;
  38.  *       &lt;/sequence&gt;
  39.  *     &lt;/restriction&gt;
  40.  *   &lt;/complexContent&gt;
  41.  * &lt;/complexType&gt;
  42.  * </pre>
  43.  *
  44.  *
  45.  */
  46. @XmlAccessorType(XmlAccessType.FIELD)
  47. @XmlType(name = "Price", propOrder = {
  48.     "currency",
  49.     "amount"
  50. })
  51. public class Price implements Serializable, Equals2, HashCode2, ToString2
  52. {

  53.     private final static long serialVersionUID = 100L;
  54.     @XmlElement(required = true)
  55.     @XmlJavaTypeAdapter(Adapter2 .class)
  56.     protected String currency;
  57.     @XmlElement(required = true)
  58.     protected BigDecimal amount;

  59.     /**
  60.      * Gets the value of the currency property.
  61.      *
  62.      * @return
  63.      *     possible object is
  64.      *     {@link String }
  65.      *    
  66.      */
  67.     public String getCurrency() {
  68.         return currency;
  69.     }

  70.     /**
  71.      * Sets the value of the currency property.
  72.      *
  73.      * @param value
  74.      *     allowed object is
  75.      *     {@link String }
  76.      *    
  77.      */
  78.     public void setCurrency(String value) {
  79.         this.currency = value;
  80.     }

  81.     /**
  82.      * Gets the value of the amount property.
  83.      *
  84.      * @return
  85.      *     possible object is
  86.      *     {@link BigDecimal }
  87.      *    
  88.      */
  89.     public BigDecimal getAmount() {
  90.         return amount;
  91.     }

  92.     /**
  93.      * Sets the value of the amount property.
  94.      *
  95.      * @param value
  96.      *     allowed object is
  97.      *     {@link BigDecimal }
  98.      *    
  99.      */
  100.     public void setAmount(BigDecimal value) {
  101.         this.amount = value;
  102.     }

  103.     public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
  104.         if ((object == null)||(this.getClass()!= object.getClass())) {
  105.             return false;
  106.         }
  107.         if (this == object) {
  108.             return true;
  109.         }
  110.         final Price that = ((Price) object);
  111.         {
  112.             String lhsCurrency;
  113.             lhsCurrency = this.getCurrency();
  114.             String rhsCurrency;
  115.             rhsCurrency = that.getCurrency();
  116.             if (!strategy.equals(LocatorUtils.property(thisLocator, "currency", lhsCurrency), LocatorUtils.property(thatLocator, "currency", rhsCurrency), lhsCurrency, rhsCurrency, (this.currency!= null), (that.currency!= null))) {
  117.                 return false;
  118.             }
  119.         }
  120.         {
  121.             BigDecimal lhsAmount;
  122.             lhsAmount = this.getAmount();
  123.             BigDecimal rhsAmount;
  124.             rhsAmount = that.getAmount();
  125.             if (!strategy.equals(LocatorUtils.property(thisLocator, "amount", lhsAmount), LocatorUtils.property(thatLocator, "amount", rhsAmount), lhsAmount, rhsAmount, (this.amount!= null), (that.amount!= null))) {
  126.                 return false;
  127.             }
  128.         }
  129.         return true;
  130.     }

  131.     public boolean equals(Object object) {
  132.         final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
  133.         return equals(null, null, object, strategy);
  134.     }

  135.     public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) {
  136.         int currentHashCode = 1;
  137.         {
  138.             String theCurrency;
  139.             theCurrency = this.getCurrency();
  140.             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "currency", theCurrency), currentHashCode, theCurrency, (this.currency!= null));
  141.         }
  142.         {
  143.             BigDecimal theAmount;
  144.             theAmount = this.getAmount();
  145.             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "amount", theAmount), currentHashCode, theAmount, (this.amount!= null));
  146.         }
  147.         return currentHashCode;
  148.     }

  149.     public int hashCode() {
  150.         final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.INSTANCE;
  151.         return this.hashCode(null, strategy);
  152.     }

  153.     public String toString() {
  154.         final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
  155.         final StringBuilder buffer = new StringBuilder();
  156.         append(null, buffer, strategy);
  157.         return buffer.toString();
  158.     }

  159.     public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
  160.         strategy.appendStart(locator, this, buffer);
  161.         appendFields(locator, buffer, strategy);
  162.         strategy.appendEnd(locator, this, buffer);
  163.         return buffer;
  164.     }

  165.     public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
  166.         {
  167.             String theCurrency;
  168.             theCurrency = this.getCurrency();
  169.             strategy.appendField(locator, this, "currency", buffer, theCurrency, (this.currency!= null));
  170.         }
  171.         {
  172.             BigDecimal theAmount;
  173.             theAmount = this.getAmount();
  174.             strategy.appendField(locator, this, "amount", buffer, theAmount, (this.amount!= null));
  175.         }
  176.         return buffer;
  177.     }

  178. }