mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -111,7 +111,7 @@ public enum Ansi4BitBackgroundColor implements AnsiElement {
|
||||
|
||||
private final int code;
|
||||
|
||||
Ansi4BitBackgroundColor(int code) {
|
||||
Ansi4BitBackgroundColor(final int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public enum Ansi4BitBackgroundColor implements AnsiElement {
|
||||
* @param isBackground 是否背景色
|
||||
* @return 颜色代码
|
||||
*/
|
||||
public int getCode(boolean isBackground) {
|
||||
public int getCode(final boolean isBackground) {
|
||||
return isBackground ? this.code : this.code - 10;
|
||||
}
|
||||
|
||||
@@ -155,8 +155,8 @@ public enum Ansi4BitBackgroundColor implements AnsiElement {
|
||||
* @param code Ansi 4bit 颜色代码
|
||||
* @return Ansi4BitBackgroundColor
|
||||
*/
|
||||
public static Ansi4BitBackgroundColor of(int code) {
|
||||
for (Ansi4BitBackgroundColor item : Ansi4BitBackgroundColor.values()) {
|
||||
public static Ansi4BitBackgroundColor of(final int code) {
|
||||
for (final Ansi4BitBackgroundColor item : Ansi4BitBackgroundColor.values()) {
|
||||
if (item.getCode() == code) {
|
||||
return item;
|
||||
}
|
||||
|
@@ -111,7 +111,7 @@ public enum Ansi4BitColor implements AnsiElement {
|
||||
|
||||
private final int code;
|
||||
|
||||
Ansi4BitColor(int code) {
|
||||
Ansi4BitColor(final int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public enum Ansi4BitColor implements AnsiElement {
|
||||
* @param isBackground 是否背景色
|
||||
* @return 颜色代码
|
||||
*/
|
||||
public int getCode(boolean isBackground) {
|
||||
public int getCode(final boolean isBackground) {
|
||||
return isBackground ? this.code + 10 : this.code;
|
||||
}
|
||||
|
||||
@@ -155,8 +155,8 @@ public enum Ansi4BitColor implements AnsiElement {
|
||||
* @param code Ansi 4bit 颜色代码
|
||||
* @return Ansi4BitColor
|
||||
*/
|
||||
public static Ansi4BitColor of(int code) {
|
||||
for (Ansi4BitColor item : Ansi4BitColor.values()) {
|
||||
public static Ansi4BitColor of(final int code) {
|
||||
for (final Ansi4BitColor item : Ansi4BitColor.values()) {
|
||||
if (item.getCode() == code) {
|
||||
return item;
|
||||
}
|
||||
|
Reference in New Issue
Block a user