zoukankan      html  css  js  c++  java
  • shop--9.商品--辅助工具

    ProductStateEnum

    public enum ProductStateEnum {
        SUCCESS(1, "插入成功"), INNER_ERROR(-1001, "操作失败");
        
        private int state;
        private String stateInfo;
    
        ProductStateEnum(int state, String stateInfo) {
            this.state = state;
            this.stateInfo = stateInfo;
        }
        
        public int getState() {
            return state;
        }
    
        public String getStateInfo() {
            return stateInfo;
        }
    }
    

      

    ProductOperationException

    public class ProductOperationException extends RuntimeException {
        private static final long serialVersionUID = -6851228251862891341L;
    
        public ProductOperationException(String message) {
            super( message );
        }
    }
    

      

    ProductExecution

    public class ProductExecution {
        private int state;
        private String stateInfo;
        private int count;
        private Product product;
        private List<Product> productList;
    
        public ProductExecution(){
    
        }
        //操作失败的构造器
        public ProductExecution(ProductStateEnum productStateEnum) {
            this.state = productStateEnum.getState();
            this.stateInfo = productStateEnum.getStateInfo();
        }
    
    
        //操作成功的构造器1  单个商品
        public ProductExecution(ProductStateEnum productStateEnum, Product product){
            this.state = productStateEnum.getState();
            this.stateInfo = productStateEnum.getStateInfo();
            this.product = product;
        }
    
        //操作成功的构造器2  多个商品
        public ProductExecution(ProductStateEnum productStateEnum, List<Product> productList){
            this.state = productStateEnum.getState();
            this.stateInfo = productStateEnum.getStateInfo();
            this.productList = productList;
        }
    
    
        public int getState() {
            return state;
        }
    
        public void setState(int state) {
            this.state = state;
        }
    
        public String getStateInfo() {
            return stateInfo;
        }
    
        public void setStateInfo(String stateInfo) {
            this.stateInfo = stateInfo;
        }
    
        public int getCount() {
            return count;
        }
    
        public void setCount(int count) {
            this.count = count;
        }
    
        public Product getProduct() {
            return product;
        }
    
        public void setProduct(Product product) {
            this.product = product;
        }
    
        public List<Product> getProductList() {
            return productList;
        }
    
        public void setProductList(List<Product> productList) {
            this.productList = productList;
        }
    }
    

      

  • 相关阅读:
    Android--从路径中提取文件名
    Android--全局变量 很好很强大
    Android数据库升级实例
    eclipse中maven项目部署到tomcat [转]
    【项目管理和构建】十分钟教程,eclipse配置maven + 创建maven项目
    maven下载和安装
    Maven 在eclipse中如何配置
    怎么查看eclipse是否支持maven
    证书
    Tomcat7中开启gzip压缩功能的配置方法
  • 原文地址:https://www.cnblogs.com/SkyeAngel/p/8991426.html
Copyright © 2011-2022 走看看