View Javadoc
1   /*
2    * Copyright 2020-2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.software.common;
6   
7   import oshi.annotation.concurrent.ThreadSafe;
8   import oshi.software.os.OSFileStore;
9   
10  /**
11   * Common implementations for OSFileStore
12   */
13  @ThreadSafe
14  public abstract class AbstractOSFileStore implements OSFileStore {
15  
16      private String name;
17      private String volume;
18      private String label;
19      private String mount;
20      private String options;
21      private String uuid;
22  
23      protected AbstractOSFileStore(String name, String volume, String label, String mount, String options, String uuid) {
24          this.name = name;
25          this.volume = volume;
26          this.label = label;
27          this.mount = mount;
28          this.options = options;
29          this.uuid = uuid;
30      }
31  
32      protected AbstractOSFileStore() {
33      }
34  
35      @Override
36      public String getName() {
37          return this.name;
38      }
39  
40      @Override
41      public String getVolume() {
42          return this.volume;
43      }
44  
45      @Override
46      public String getLabel() {
47          return this.label;
48      }
49  
50      @Override
51      public String getMount() {
52          return this.mount;
53      }
54  
55      @Override
56      public String getOptions() {
57          return options;
58      }
59  
60      @Override
61      public String getUUID() {
62          return this.uuid;
63      }
64  
65      @Override
66      public String toString() {
67          return "OSFileStore [name=" + getName() + ", volume=" + getVolume() + ", label=" + getLabel()
68                  + ", logicalVolume=" + getLogicalVolume() + ", mount=" + getMount() + ", description="
69                  + getDescription() + ", fsType=" + getType() + ", options=\"" + getOptions() + "\", uuid=" + getUUID()
70                  + ", freeSpace=" + getFreeSpace() + ", usableSpace=" + getUsableSpace() + ", totalSpace="
71                  + getTotalSpace() + ", freeInodes=" + getFreeInodes() + ", totalInodes=" + getTotalInodes() + "]";
72      }
73  }