Class Product


  • public class Product
    extends java.lang.Object
    Product class
    • Field Detail

      • price

        private javax.money.MonetaryAmount price
      • startPrice

        private final javax.money.MonetaryAmount startPrice
      • name

        private java.lang.String name
    • Constructor Detail

      • Product

        public Product​(java.lang.String name,
                       ProductType productType,
                       double m)
    • Method Detail

      • tick

        public boolean tick()
        Passes tick onto current operation
        Returns:
        operation is active
      • setStateToAvailable

        public void setStateToAvailable()
        Set current product state to AVAILABLE. Throws IllegalStateException if the product is not IN_ACTION, READY_FOR_RECEPTION or IN_REQUIREMENT.
      • setStateToReadyForDispatch

        public void setStateToReadyForDispatch()
        Set current product state to READY_FOR_DISPATCH. Throws IllegalStateException if the product is not IN_REQUIREMENT.
      • setStateToInTransit

        public void setStateToInTransit()
        Set current product state to IN_TRANSIT. Throws IllegalStateException if the product is not READY_FOR_DISPATCH.
      • setStateToReadyForReception

        public void setStateToReadyForReception()
        Set current product state to READY_FOR_RECEPTION. Throws IllegalStateException if the product is not READY_FOR_RECEPTION.
      • setStateToInAction

        public void setStateToInAction()
        Set current product state to IN_ACTION. Throws IllegalStateException if the product is not AVAILABLE.
      • setStateToInRequirement

        public void setStateToInRequirement()
        Set current product state to IN_REQUIREMENT. Throws IllegalStateException if the product is not AVAILABLE.
      • setProductType

        public void setProductType​(ProductType productType)
      • getName

        public java.lang.String getName()
      • setName

        public void setName​(java.lang.String name)
      • getCurrentOperation

        public OperationBase getCurrentOperation()
      • setCurrentOperation

        public void setCurrentOperation​(OperationBase currentOperation)
      • getPrice

        public javax.money.MonetaryAmount getPrice()
      • setPrice

        public void setPrice​(javax.money.MonetaryAmount price)
      • getStartPrice

        public javax.money.MonetaryAmount getStartPrice()
      • getListOfOperations

        public java.util.List<OperationBase> getListOfOperations()