From 78111aff202226530ebdd57d3a12c19145467751 Mon Sep 17 00:00:00 2001 From: smartwyy <645583145@qq.com> Date: Thu, 30 May 2024 18:46:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=9F=BA=E7=A1=80=E6=A1=86?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HybirdFrameworkCore/Utils/ObjUtils.cs | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 HybirdFrameworkCore/Utils/ObjUtils.cs diff --git a/HybirdFrameworkCore/Utils/ObjUtils.cs b/HybirdFrameworkCore/Utils/ObjUtils.cs new file mode 100644 index 0000000..fb39f97 --- /dev/null +++ b/HybirdFrameworkCore/Utils/ObjUtils.cs @@ -0,0 +1,71 @@ +namespace HybirdFrameworkCore.Utils; + +/// +/// +/// +public static class ObjUtils +{ + /// + /// + /// + /// + /// + public static bool IsNull(object? o) + { + return o == null; + } + + /// + /// + /// + /// + /// + public static bool IsNotNull(object? o) + { + return o != null; + } + + /// + /// + /// + /// + /// + /// + public static bool IsEmpty(List? list) + { + return list == null || list.Count == 0; + } + + /// + /// + /// + /// + /// + /// + public static bool IsNotEmpty(List? list) + { + return list is { Count: >= 0 }; + } + + /// + /// + /// + /// + /// + public static bool IsNullOrWhiteSpace(string? o) + { + return string.IsNullOrWhiteSpace(o); + } + + /// + /// + /// + /// + /// + public static bool IsNotNullOrWhiteSpace(string? o) + { + return !string.IsNullOrWhiteSpace(o); + } + + public static readonly List EmptyList = new List(0); +} \ No newline at end of file