content: /*
   * Copyright 2012-2013 Cooma Team.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package com.alibaba.cooma.internal.utils;
  
  /**
   * Holds a value of type <code>T</code>.
   *
   * @author Jerry Lee(oldratlee AT gmail DOT com)
   * @since 0.1.0
   */
  public final class Holder<T> {
  
      /**
       * The value contained in the holder.
       */
      private volatile T value;
  
      /**
       * Creates a new holder with a <code>null</code> value.
       */
      public Holder() {
      }
  
      /**
       * Create a new holder with the specified value.
       *
       * @param value The value to be stored in the holder.
       */
      public Holder(T value) {
          this.value = value;
      }
  
      public T get() {
          return value;
      }
  
      public void set(T value) {
          this.value = value;
      }
  }
  