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