1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html#License
3 /*
4  *******************************************************************************
5  * Copyright (C) 2011-2016, International Business Machines Corporation and    *
6  * others. All Rights Reserved.                                                *
7  *******************************************************************************
8  */
9 package com.ibm.icu.util;
10 
11 /**
12  * Simple struct-like class for output parameters.
13  * @param <T> The type of the parameter.
14  * @stable ICU 4.8
15  */
16 public class Output<T> {
17     /**
18      * The value field
19      * @stable ICU 4.8
20      */
21     public T value;
22 
23     /**
24      * {@inheritDoc}
25      * @stable ICU 4.8
26      */
27     @Override
toString()28     public String toString() {
29         return value == null ? "null" : value.toString();
30     }
31 
32     /**
33      * Constructs an empty <code>Output</code>
34      * @stable ICU 4.8
35      */
Output()36     public Output() {
37 
38     }
39 
40     /**
41      * Constructs an <code>Output</code> with the given value.
42      * @param value the initial value
43      * @stable ICU 4.8
44      */
Output(T value)45     public Output(T value) {
46         this.value = value;
47     }
48 }
49