001/* 002 * 003 * Licensed to the Apache Software Foundation (ASF) under one 004 * or more contributor license agreements. See the NOTICE file 005 * distributed with this work for additional information 006 * regarding copyright ownership. The ASF licenses this file 007 * to you under the Apache License, Version 2.0 (the 008 * "License"); you may not use this file except in compliance 009 * with the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 */ 019 020package org.apache.hadoop.hbase.rest.model; 021 022import java.io.Serializable; 023 024import javax.xml.bind.annotation.XmlAttribute; 025import javax.xml.bind.annotation.XmlRootElement; 026 027import org.apache.yetus.audience.InterfaceAudience; 028 029/** 030 * Simple representation of the version of the storage cluster 031 * 032 * <pre> 033 * <complexType name="StorageClusterVersion"> 034 * <attribute name="version" type="string"></attribute> 035 * </complexType> 036 * </pre> 037 */ 038@XmlRootElement(name="ClusterVersion") 039@InterfaceAudience.Private 040public class StorageClusterVersionModel implements Serializable { 041 private static final long serialVersionUID = 1L; 042 043 private String version; 044 045 /** 046 * @return the storage cluster version 047 */ 048 @XmlAttribute(name="Version") 049 public String getVersion() { 050 return version; 051 } 052 053 /** 054 * @param version the storage cluster version 055 */ 056 public void setVersion(String version) { 057 this.version = version; 058 } 059 060 /* (non-Javadoc) 061 * @see java.lang.Object#toString() 062 */ 063 @Override 064 public String toString() { 065 return version; 066 } 067 068 //needed for jackson deserialization 069 private static StorageClusterVersionModel valueOf(String value) { 070 StorageClusterVersionModel versionModel 071 = new StorageClusterVersionModel(); 072 versionModel.setVersion(value); 073 return versionModel; 074 } 075}