Added setStateToInRequirement that I forgot earlier
This commit is contained in:
parent
1771fc0fdb
commit
4fba75b0e1
@ -84,14 +84,14 @@ public class Product
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current product state to READY_FOR_DISPATCH. Throws IllegalStateException if the product is not AVAILABLE.
|
||||
* Set current product state to READY_FOR_DISPATCH. Throws IllegalStateException if the product is not IN_REQUIREMENT.
|
||||
*/
|
||||
public void setStateToReadyForDispatch()
|
||||
{
|
||||
if(this.productState.equals(ProductState.AVAILABLE))
|
||||
if(this.productState.equals(ProductState.IN_REQUIREMENT))
|
||||
this.productState = ProductState.READY_FOR_DISPATCH;
|
||||
else
|
||||
throw new IllegalStateException("Cannot set state READY_FOR_DISPATCH. Product is not AVAILABLE!");
|
||||
throw new IllegalStateException("Cannot set state READY_FOR_DISPATCH. Product is not IN_REQUIREMENT!");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -127,6 +127,17 @@ public class Product
|
||||
throw new IllegalStateException("Cannot set state IN_ACTION. Product is not AVAILABLE!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current product state to IN_REQUIREMENT. Throws IllegalStateException if the product is not AVAILABLE.
|
||||
*/
|
||||
public void setStateToInRequirement()
|
||||
{
|
||||
if(this.productState.equals(ProductState.AVAILABLE))
|
||||
this.productState = ProductState.IN_REQUIREMENT;
|
||||
else
|
||||
throw new IllegalStateException("Cannot set state IN_REQUIREMENT. Product is not AVAILABLE!");
|
||||
}
|
||||
|
||||
/*
|
||||
public void setProductState(ProductState productState)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user