Back to home page

OSCL-LXR

 
 

    


0001 /**
0002  * Licensed to the Apache Software Foundation (ASF) under one
0003  * or more contributor license agreements.  See the NOTICE file
0004  * distributed with this work for additional information
0005  * regarding copyright ownership.  The ASF licenses this file
0006  * to you under the Apache License, Version 2.0 (the
0007  * "License"); you may not use this file except in compliance
0008  * with the License.  You may obtain a copy of the License at
0009  *
0010  *     http://www.apache.org/licenses/LICENSE-2.0
0011  *
0012  * Unless required by applicable law or agreed to in writing, software
0013  * distributed under the License is distributed on an "AS IS" BASIS,
0014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0015  * See the License for the specific language governing permissions and
0016  * limitations under the License.
0017  */
0018 
0019 package org.apache.hive.service.cli;
0020 
0021 import org.apache.hive.service.rpc.thrift.TGetInfoValue;
0022 
0023 /**
0024  * GetInfoValue.
0025  *
0026  */
0027 public class GetInfoValue {
0028   private String stringValue = null;
0029   private short shortValue;
0030   private int intValue;
0031   private long longValue;
0032 
0033   public GetInfoValue(String stringValue) {
0034     this.stringValue = stringValue;
0035   }
0036 
0037   public GetInfoValue(short shortValue) {
0038     this.shortValue = shortValue;
0039   }
0040 
0041   public GetInfoValue(int intValue) {
0042     this.intValue = intValue;
0043   }
0044 
0045   public GetInfoValue(long longValue) {
0046     this.longValue = longValue;
0047   }
0048 
0049   public GetInfoValue(TGetInfoValue tGetInfoValue) {
0050     switch (tGetInfoValue.getSetField()) {
0051     case STRING_VALUE:
0052       stringValue = tGetInfoValue.getStringValue();
0053       break;
0054     default:
0055       throw new IllegalArgumentException("Unreconigzed TGetInfoValue");
0056     }
0057   }
0058 
0059   public TGetInfoValue toTGetInfoValue() {
0060     TGetInfoValue tInfoValue = new TGetInfoValue();
0061     if (stringValue != null) {
0062       tInfoValue.setStringValue(stringValue);
0063     }
0064     return tInfoValue;
0065   }
0066 
0067   public String getStringValue() {
0068     return stringValue;
0069   }
0070 
0071   public short getShortValue() {
0072     return shortValue;
0073   }
0074 
0075   public int getIntValue() {
0076     return intValue;
0077   }
0078 
0079   public long getLongValue() {
0080     return longValue;
0081   }
0082 }