View Javadoc
1   /*
2    * Copyright 2020-2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.util.tuples;
6   
7   import oshi.annotation.concurrent.ThreadSafe;
8   
9   /**
10   * Convenience class for returning multiple objects from methods.
11   *
12   * @param <A> Type of the first element
13   * @param <B> Type of the second element
14   * @param <C> Type of the third element
15   * @param <D> Type of the fourth element
16   * @param <E> Type of the fifth element
17   */
18  @ThreadSafe
19  public class Quintet<A, B, C, D, E> {
20  
21      private final A a;
22      private final B b;
23      private final C c;
24      private final D d;
25      private final E e;
26  
27      /**
28       * Create a quintet and store five objects.
29       *
30       * @param a the first object to store
31       * @param b the second object to store
32       * @param c the third object to store
33       * @param d the fourth object to store
34       * @param e the fifth object to store
35       */
36      public Quintet(A a, B b, C c, D d, E e) {
37          this.a = a;
38          this.b = b;
39          this.c = c;
40          this.d = d;
41          this.e = e;
42      }
43  
44      /**
45       * Returns the first stored object.
46       *
47       * @return first object stored
48       */
49      public final A getA() {
50          return a;
51      }
52  
53      /**
54       * Returns the second stored object.
55       *
56       * @return second object stored
57       */
58      public final B getB() {
59          return b;
60      }
61  
62      /**
63       * Returns the third stored object.
64       *
65       * @return third object stored
66       */
67      public final C getC() {
68          return c;
69      }
70  
71      /**
72       * Returns the fourth stored object.
73       *
74       * @return fourth object stored
75       */
76      public final D getD() {
77          return d;
78      }
79  
80      /**
81       * Returns the fifth stored object.
82       *
83       * @return fifth object stored
84       */
85      public final E getE() {
86          return e;
87      }
88  }