Stock.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.04.11 at 07:15:59 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.XmlAttribute;
  13. import javax.xml.bind.annotation.XmlElement;
  14. import javax.xml.bind.annotation.XmlType;
  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 Stock complex type.
  28.  *
  29.  * <p>The following schema fragment specifies the expected content contained within this class.
  30.  *
  31.  * <pre>
  32.  * &lt;complexType name="Stock"&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="name" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
  37.  *         &lt;element name="price" type="{http://phisix-api.appspot.com/phisix-stocks}Price"/&gt;
  38.  *         &lt;element name="percent_change" type="{http://www.w3.org/2001/XMLSchema}decimal"/&gt;
  39.  *         &lt;element name="volume" type="{http://www.w3.org/2001/XMLSchema}long"/&gt;
  40.  *       &lt;/sequence&gt;
  41.  *       &lt;attribute name="symbol" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
  42.  *     &lt;/restriction&gt;
  43.  *   &lt;/complexContent&gt;
  44.  * &lt;/complexType&gt;
  45.  * </pre>
  46.  *
  47.  *
  48.  */
  49. @XmlAccessorType(XmlAccessType.FIELD)
  50. @XmlType(name = "Stock", propOrder = {
  51.     "name",
  52.     "price",
  53.     "percentChange",
  54.     "volume"
  55. })
  56. public class Stock implements Serializable, Equals2, HashCode2, ToString2
  57. {

  58.     private final static long serialVersionUID = 100L;
  59.     @XmlElement(required = true)
  60.     protected String name;
  61.     @XmlElement(required = true)
  62.     protected Price price;
  63.     @XmlElement(name = "percent_change", required = true)
  64.     protected BigDecimal percentChange;
  65.     protected long volume;
  66.     @XmlAttribute(name = "symbol", required = true)
  67.     protected String symbol;

  68.     /**
  69.      * Gets the value of the name property.
  70.      *
  71.      * @return
  72.      *     possible object is
  73.      *     {@link String }
  74.      *    
  75.      */
  76.     public String getName() {
  77.         return name;
  78.     }

  79.     /**
  80.      * Sets the value of the name property.
  81.      *
  82.      * @param value
  83.      *     allowed object is
  84.      *     {@link String }
  85.      *    
  86.      */
  87.     public void setName(String value) {
  88.         this.name = value;
  89.     }

  90.     /**
  91.      * Gets the value of the price property.
  92.      *
  93.      * @return
  94.      *     possible object is
  95.      *     {@link Price }
  96.      *    
  97.      */
  98.     public Price getPrice() {
  99.         return price;
  100.     }

  101.     /**
  102.      * Sets the value of the price property.
  103.      *
  104.      * @param value
  105.      *     allowed object is
  106.      *     {@link Price }
  107.      *    
  108.      */
  109.     public void setPrice(Price value) {
  110.         this.price = value;
  111.     }

  112.     /**
  113.      * Gets the value of the percentChange property.
  114.      *
  115.      * @return
  116.      *     possible object is
  117.      *     {@link BigDecimal }
  118.      *    
  119.      */
  120.     public BigDecimal getPercentChange() {
  121.         return percentChange;
  122.     }

  123.     /**
  124.      * Sets the value of the percentChange property.
  125.      *
  126.      * @param value
  127.      *     allowed object is
  128.      *     {@link BigDecimal }
  129.      *    
  130.      */
  131.     public void setPercentChange(BigDecimal value) {
  132.         this.percentChange = value;
  133.     }

  134.     /**
  135.      * Gets the value of the volume property.
  136.      *
  137.      */
  138.     public long getVolume() {
  139.         return volume;
  140.     }

  141.     /**
  142.      * Sets the value of the volume property.
  143.      *
  144.      */
  145.     public void setVolume(long value) {
  146.         this.volume = value;
  147.     }

  148.     /**
  149.      * Gets the value of the symbol property.
  150.      *
  151.      * @return
  152.      *     possible object is
  153.      *     {@link String }
  154.      *    
  155.      */
  156.     public String getSymbol() {
  157.         return symbol;
  158.     }

  159.     /**
  160.      * Sets the value of the symbol property.
  161.      *
  162.      * @param value
  163.      *     allowed object is
  164.      *     {@link String }
  165.      *    
  166.      */
  167.     public void setSymbol(String value) {
  168.         this.symbol = value;
  169.     }

  170.     public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
  171.         if ((object == null)||(this.getClass()!= object.getClass())) {
  172.             return false;
  173.         }
  174.         if (this == object) {
  175.             return true;
  176.         }
  177.         final Stock that = ((Stock) object);
  178.         {
  179.             String lhsName;
  180.             lhsName = this.getName();
  181.             String rhsName;
  182.             rhsName = that.getName();
  183.             if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName, (this.name!= null), (that.name!= null))) {
  184.                 return false;
  185.             }
  186.         }
  187.         {
  188.             Price lhsPrice;
  189.             lhsPrice = this.getPrice();
  190.             Price rhsPrice;
  191.             rhsPrice = that.getPrice();
  192.             if (!strategy.equals(LocatorUtils.property(thisLocator, "price", lhsPrice), LocatorUtils.property(thatLocator, "price", rhsPrice), lhsPrice, rhsPrice, (this.price!= null), (that.price!= null))) {
  193.                 return false;
  194.             }
  195.         }
  196.         {
  197.             BigDecimal lhsPercentChange;
  198.             lhsPercentChange = this.getPercentChange();
  199.             BigDecimal rhsPercentChange;
  200.             rhsPercentChange = that.getPercentChange();
  201.             if (!strategy.equals(LocatorUtils.property(thisLocator, "percentChange", lhsPercentChange), LocatorUtils.property(thatLocator, "percentChange", rhsPercentChange), lhsPercentChange, rhsPercentChange, (this.percentChange!= null), (that.percentChange!= null))) {
  202.                 return false;
  203.             }
  204.         }
  205.         {
  206.             long lhsVolume;
  207.             lhsVolume = this.getVolume();
  208.             long rhsVolume;
  209.             rhsVolume = that.getVolume();
  210.             if (!strategy.equals(LocatorUtils.property(thisLocator, "volume", lhsVolume), LocatorUtils.property(thatLocator, "volume", rhsVolume), lhsVolume, rhsVolume, true, true)) {
  211.                 return false;
  212.             }
  213.         }
  214.         {
  215.             String lhsSymbol;
  216.             lhsSymbol = this.getSymbol();
  217.             String rhsSymbol;
  218.             rhsSymbol = that.getSymbol();
  219.             if (!strategy.equals(LocatorUtils.property(thisLocator, "symbol", lhsSymbol), LocatorUtils.property(thatLocator, "symbol", rhsSymbol), lhsSymbol, rhsSymbol, (this.symbol!= null), (that.symbol!= null))) {
  220.                 return false;
  221.             }
  222.         }
  223.         return true;
  224.     }

  225.     public boolean equals(Object object) {
  226.         final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
  227.         return equals(null, null, object, strategy);
  228.     }

  229.     public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) {
  230.         int currentHashCode = 1;
  231.         {
  232.             String theName;
  233.             theName = this.getName();
  234.             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName, (this.name!= null));
  235.         }
  236.         {
  237.             Price thePrice;
  238.             thePrice = this.getPrice();
  239.             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "price", thePrice), currentHashCode, thePrice, (this.price!= null));
  240.         }
  241.         {
  242.             BigDecimal thePercentChange;
  243.             thePercentChange = this.getPercentChange();
  244.             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "percentChange", thePercentChange), currentHashCode, thePercentChange, (this.percentChange!= null));
  245.         }
  246.         {
  247.             long theVolume;
  248.             theVolume = this.getVolume();
  249.             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "volume", theVolume), currentHashCode, theVolume, true);
  250.         }
  251.         {
  252.             String theSymbol;
  253.             theSymbol = this.getSymbol();
  254.             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "symbol", theSymbol), currentHashCode, theSymbol, (this.symbol!= null));
  255.         }
  256.         return currentHashCode;
  257.     }

  258.     public int hashCode() {
  259.         final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.INSTANCE;
  260.         return this.hashCode(null, strategy);
  261.     }

  262.     public String toString() {
  263.         final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
  264.         final StringBuilder buffer = new StringBuilder();
  265.         append(null, buffer, strategy);
  266.         return buffer.toString();
  267.     }

  268.     public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
  269.         strategy.appendStart(locator, this, buffer);
  270.         appendFields(locator, buffer, strategy);
  271.         strategy.appendEnd(locator, this, buffer);
  272.         return buffer;
  273.     }

  274.     public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
  275.         {
  276.             String theName;
  277.             theName = this.getName();
  278.             strategy.appendField(locator, this, "name", buffer, theName, (this.name!= null));
  279.         }
  280.         {
  281.             Price thePrice;
  282.             thePrice = this.getPrice();
  283.             strategy.appendField(locator, this, "price", buffer, thePrice, (this.price!= null));
  284.         }
  285.         {
  286.             BigDecimal thePercentChange;
  287.             thePercentChange = this.getPercentChange();
  288.             strategy.appendField(locator, this, "percentChange", buffer, thePercentChange, (this.percentChange!= null));
  289.         }
  290.         {
  291.             long theVolume;
  292.             theVolume = this.getVolume();
  293.             strategy.appendField(locator, this, "volume", buffer, theVolume, true);
  294.         }
  295.         {
  296.             String theSymbol;
  297.             theSymbol = this.getSymbol();
  298.             strategy.appendField(locator, this, "symbol", buffer, theSymbol, (this.symbol!= null));
  299.         }
  300.         return buffer;
  301.     }

  302. }