View Javadoc
1   /*
2    * Copyright 2019-2024 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.util;
6   
7   import java.time.Instant;
8   import java.time.OffsetDateTime;
9   import java.time.ZoneOffset;
10  import java.util.regex.Pattern;
11  
12  import oshi.annotation.concurrent.ThreadSafe;
13  
14  /**
15   * General constants used in multiple classes
16   */
17  @ThreadSafe
18  public final class Constants {
19  
20      /**
21       * String to report for unknown information
22       */
23      public static final String UNKNOWN = "unknown";
24  
25      /**
26       * The Unix Epoch, a default value when WMI DateTime queries return no value.
27       */
28      public static final OffsetDateTime UNIX_EPOCH = OffsetDateTime.ofInstant(Instant.EPOCH, ZoneOffset.UTC);
29  
30      public static final Pattern DIGITS = Pattern.compile("\\d+");
31  
32      /**
33       * Everything in this class is static, never instantiate it
34       */
35      private Constants() {
36          throw new AssertionError();
37      }
38  }