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