Home | History | Annotate | Download | only in util
      1 /*
      2  *******************************************************************************
      3  * Copyright (C) 2011-2012, International Business Machines Corporation and    *
      4  * others. All Rights Reserved.                                                *
      5  *******************************************************************************
      6  */
      7 package com.ibm.icu.util;
      8 
      9 /**
     10  * Simple struct-like class for output parameters.
     11  * @param <T> The type of the parameter.
     12  * @stable ICU 4.8
     13  */
     14 public class Output<T> {
     15     /**
     16      * The value field
     17      * @stable ICU 4.8
     18      */
     19     public T value;
     20 
     21     /**
     22      * {@inheritDoc}
     23      * @stable ICU 4.8
     24      */
     25     public String toString() {
     26         return value == null ? "null" : value.toString();
     27     }
     28 
     29     /**
     30      * Constructs an empty <code>Output</code>
     31      * @stable ICU 4.8
     32      */
     33     public Output() {
     34 
     35     }
     36 
     37     /**
     38      * Constructs an <code>Output</code> withe the given value.
     39      * @param value the initial value
     40      * @stable ICU 4.8
     41      */
     42     public Output(T value) {
     43         this.value = value;
     44     }
     45 }
     46