View Javadoc
1   /*
2    * Copyright 2016-2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.hardware.platform.mac;
6   
7   import java.util.List;
8   
9   import oshi.annotation.concurrent.ThreadSafe;
10  import oshi.hardware.CentralProcessor;
11  import oshi.hardware.ComputerSystem;
12  import oshi.hardware.Display;
13  import oshi.hardware.GlobalMemory;
14  import oshi.hardware.GraphicsCard;
15  import oshi.hardware.HWDiskStore;
16  import oshi.hardware.LogicalVolumeGroup;
17  import oshi.hardware.NetworkIF;
18  import oshi.hardware.PowerSource;
19  import oshi.hardware.Sensors;
20  import oshi.hardware.SoundCard;
21  import oshi.hardware.UsbDevice;
22  import oshi.hardware.common.AbstractHardwareAbstractionLayer;
23  
24  /**
25   * MacHardwareAbstractionLayer class.
26   */
27  @ThreadSafe
28  public final class MacHardwareAbstractionLayer extends AbstractHardwareAbstractionLayer {
29  
30      @Override
31      public ComputerSystem createComputerSystem() {
32          return new MacComputerSystem();
33      }
34  
35      @Override
36      public GlobalMemory createMemory() {
37          return new MacGlobalMemory();
38      }
39  
40      @Override
41      public CentralProcessor createProcessor() {
42          return new MacCentralProcessor();
43      }
44  
45      @Override
46      public Sensors createSensors() {
47          return new MacSensors();
48      }
49  
50      @Override
51      public List<PowerSource> getPowerSources() {
52          return MacPowerSource.getPowerSources();
53      }
54  
55      @Override
56      public List<HWDiskStore> getDiskStores() {
57          return MacHWDiskStore.getDisks();
58      }
59  
60      @Override
61      public List<LogicalVolumeGroup> getLogicalVolumeGroups() {
62          return MacLogicalVolumeGroup.getLogicalVolumeGroups();
63      }
64  
65      @Override
66      public List<Display> getDisplays() {
67          return MacDisplay.getDisplays();
68      }
69  
70      @Override
71      public List<NetworkIF> getNetworkIFs(boolean includeLocalInterfaces) {
72          return MacNetworkIF.getNetworks(includeLocalInterfaces);
73      }
74  
75      @Override
76      public List<UsbDevice> getUsbDevices(boolean tree) {
77          return MacUsbDevice.getUsbDevices(tree);
78      }
79  
80      @Override
81      public List<SoundCard> getSoundCards() {
82          return MacSoundCard.getSoundCards();
83      }
84  
85      @Override
86      public List<GraphicsCard> getGraphicsCards() {
87          return MacGraphicsCard.getGraphicsCards();
88      }
89  }