From ea6fc4e9bb0aaa5d2436c60f599f30abc6440ef9 Mon Sep 17 00:00:00 2001 From: TomXin <766781886@qq.com> Date: Mon, 29 Aug 2022 07:05:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96AnsiColorWrapper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hutool/core/lang/ansi/AnsiColorWrapper.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/ansi/AnsiColorWrapper.java b/hutool-core/src/main/java/cn/hutool/core/lang/ansi/AnsiColorWrapper.java index bf010c492..f7bdd0b53 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/ansi/AnsiColorWrapper.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/ansi/AnsiColorWrapper.java @@ -41,23 +41,23 @@ public class AnsiColorWrapper { if (bitDepth== AnsiColors.BitDepth.FOUR){ if (foreOrBack == ForeOrBack.FORE){ for (AnsiColor item : AnsiColor.values()) { - if (StrUtil.equals(item.toString(), StrUtil.toString(code))) { + if (StrUtil.equals(item.toString(), StrUtil.toString(this.code))) { return item; } } - throw new IllegalArgumentException(StrUtil.format("No matched AnsiColor instance,code={}",code)); + throw new IllegalArgumentException(StrUtil.format("No matched AnsiColor instance,code={}",this.code)); } for (AnsiBackground item : AnsiBackground.values()) { - if (StrUtil.equals(item.toString(), StrUtil.toString(code+10))) { + if (StrUtil.equals(item.toString(), StrUtil.toString(this.code+10))) { return item; } } - throw new IllegalArgumentException(StrUtil.format("No matched Background instance,code={}",code)); + throw new IllegalArgumentException(StrUtil.format("No matched Background instance,code={}",this.code)); } if (foreOrBack == ForeOrBack.FORE){ - return Ansi8BitColor.foreground(code); + return Ansi8BitColor.foreground(this.code); } - return Ansi8BitColor.background(code); + return Ansi8BitColor.background(this.code); } @Override @@ -69,11 +69,11 @@ public class AnsiColorWrapper { return false; } AnsiColorWrapper that = (AnsiColorWrapper) o; - return code == that.code && bitDepth == that.bitDepth; + return this.code == that.code && this.bitDepth == that.bitDepth; } @Override public int hashCode() { - return Objects.hash(code, bitDepth); + return Objects.hash(this.code, this.bitDepth); } }