枚举类的方法

package com.hp.vtms;


/**
 * Created with IntelliJ IDEA.
 * User: meij
 * Date: 14-3-20
 * Time: 下午2:59
 * To change this template use File | Settings | File Templates.
 */
public enum VcloudExceptionEnum {
    _204_NO_CONTENT("204", "There is no content returned."),
    _302_MOVED_TEMPORARILY("302", "Requested resource is moved temporarily."),
    _400_BAD_REQUEST("400", "Your request is invalid."),
    _401_UNAUTHORIZED("401", "Your request is unauthorized."),
    _403_FORBIDDEN("403", "You are forbidden from vCloud server."),
    _404_NOT_FOUND("404", "No file is found on vCloud server."),
    _405_METHOD_NOT_ALLOWED("405", "Your HTTP request is not supported."),
    _406_NOT_ACCEPTABLE("406", "Note: I'm confused that what is not acceptable? "),
    _409_CONFLICT("409", "There is conflict between local environment and vCloud server."),
    _415_UNSUPPORTED_MEDIA_TYPE("415", "The media type is not supported."),
    _500_INTERNAL_SERVER_ERROR("500", "vCloud server is down."),
    _504_GATEWAY_TIMEOUT("504", "vCloud server is time out."),
    _601_VCLOUD_NOT_ASSIGNED("601", "There is no vCloud server assigned to this course."),
    _602_DATABASE_NOT_EVENT("602", "You don't have course in database."),
    _603_SFTP_CONNECT_ERR("603", "SFTP server is down.");


    public String code;
    public String errStr;
    private static final String VCLOUD = "Server temporary unavailable: ";


    VcloudExceptionEnum(String _code, String _errStr) {
        this.code = _code;
        this.errStr = VCLOUD + _errStr;
    }


   /* public static void main(String[] args) {
        System.out.println(VcloudExceptionEnum._204_NO_CONTENT.toString());
        System.out.println(VcloudExceptionEnum._204_NO_CONTENT.code);
        System.out.println(VcloudExceptionEnum._302_MOVED_TEMPORARILY.errStr);


        VcloudExceptionEnum[] allVcloudException = VcloudExceptionEnum.values();
        for (VcloudExceptionEnum vcloudExceptionEnum : allVcloudException) {
            System.out.println(vcloudExceptionEnum.errStr);
        }
    }*/
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值