Use cases for enums

enum Enum{
    
    
    /**
     * type
     */
    CGSQ("采购申请","您有一条","待审批,项目名称为:");

    private String type;
    private String messgePrefix;
    private String messgeSplice;

    public String getType() {
    
    
        return type;
    }
    public String getMessgePrefix() {
    
    
        return messgePrefix;
    }
    public String getMessgeSplice() {
    
    
        return messgeSplice;
    }
    Enum(String type, String messgePrefix, String messgeSplice) {
    
    
        this.type = type;
        this.messgePrefix = messgePrefix;
        this.messgeSplice = messgeSplice;
    }
}

public static void fun(Enum e){
    
    
    System.out.println(e.getType());
    System.out.println(e.getMessgePrefix());
    System.out.println(e.getMessgeSplice());
}

Guess you like

Origin blog.csdn.net/weixin_44063083/article/details/120073475