Coverage Summary for Class: OrderStatus (cn.edu.ecnu.stu.bookstore.pojo)

Class Class, % Method, % Line, %
OrderStatus 100% (1/1) 80% (4/5) 84.6% (11/13)


 package cn.edu.ecnu.stu.bookstore.pojo;
 
 import lombok.AllArgsConstructor;
 import lombok.NoArgsConstructor;
 
 @NoArgsConstructor
 @AllArgsConstructor
 public enum OrderStatus{
     WAIT_PAYMENT(0),
     WAIT_SEND(1),
     WAIT_RECEIVE(2),
     COMPLETED(3),
     CANCEL(4);
 
     private int value;
 
     public int getValue() {
         return value;
     }
 
     public void setValue(int value) {
         this.value = value;
     }
 
     public static OrderStatus getByValue(int val) {
         for(OrderStatus status : values()) {
             if(status.value == val)
                 return status;
         }
         return null;
     }
 }