aboutsummaryrefslogtreecommitdiff
path: root/java/com/ibm/icu/util/Output.java
blob: 2f40475cb83519366c7aa1a41019d5bc5a9a3ec7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 *******************************************************************************
 * Copyright (C) 2011-2012, International Business Machines Corporation and    *
 * others. All Rights Reserved.                                                *
 *******************************************************************************
 */
package com.ibm.icu.util;

/**
 * Simple struct-like class for output parameters.
 * @param <T> The type of the parameter.
 * @stable ICU 4.8
 */
public class Output<T> {
    /**
     * The value field
     * @stable ICU 4.8
     */
    public T value;

    /**
     * {@inheritDoc}
     * @stable ICU 4.8
     */
    public String toString() {
        return value == null ? "null" : value.toString();
    }

    /**
     * Constructs an empty <code>Output</code>
     * @stable ICU 4.8
     */
    public Output() {
        
    }

    /**
     * Constructs an <code>Output</code> withe the given value.
     * @param value the initial value
     * @stable ICU 4.8
     */
    public Output(T value) {
        this.value = value;
    }
}