1 /*
2 * Copyright 2010 The Apache Software Foundation
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21 package org.apache.hadoop.hbase.rest.model;
22
23 import java.io.Serializable;
24
25 import javax.xml.bind.annotation.XmlAttribute;
26 import javax.xml.bind.annotation.XmlRootElement;
27
28 /**
29 * Simple representation of a table name.
30 *
31 * <pre>
32 * <complexType name="Table">
33 * <sequence>
34 * <element name="name" type="string"></element>
35 * </sequence>
36 * </complexType>
37 * </pre>
38 */
39 @XmlRootElement(name="table")
40 public class TableModel implements Serializable {
41
42 private static final long serialVersionUID = 1L;
43
44 private String name;
45
46 /**
47 * Default constructor
48 */
49 public TableModel() {}
50
51 /**
52 * Constructor
53 * @param name
54 */
55 public TableModel(String name) {
56 super();
57 this.name = name;
58 }
59
60 /**
61 * @return the name
62 */
63 @XmlAttribute
64 public String getName() {
65 return name;
66 }
67
68 /**
69 * @param name the name to set
70 */
71 public void setName(String name) {
72 this.name = name;
73 }
74
75 /* (non-Javadoc)
76 * @see java.lang.Object#toString()
77 */
78 @Override
79 public String toString() {
80 return this.name;
81 }
82 }