mikuriya

Gitlab API BadRequest 的 Enum

public enum GitlabBadRequestEnum {
DirectoryExists("A file with this name already exists", "此名称的目录已存在"), //gitlab 创建目录, 目录已存在;//
;
private String message;//BadRequestContentMessage
private String messageStr;// return message

private GitlabBadRequestEnum(String message, String messageStr) {
this.message = message;
this.messageStr = messageStr;
}

// 普通方法
public static String getMessageStr(String message) {
for (GitlabBadRequestEnum c : GitlabBadRequestEnum.values()) {
if (c.getMessage().equals(message)) {
return c.getMessageStr();
}
}
return null;
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public String getMessageStr() {
return messageStr;
}

public void setMessageStr(String messageStr) {
this.messageStr = messageStr;
}
}

mikuriya,偶遇良缘。

posted on 2021-01-12 10:41  mikuriya  阅读(200)  评论(0编辑  收藏  举报

导航