001 /*
002 * SonarQube, open source software quality management tool.
003 * Copyright (C) 2008-2014 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * SonarQube is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * SonarQube is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with this program; if not, write to the Free Software Foundation,
018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
019 */
020 package org.sonar.wsclient.services;
021
022 import javax.annotation.CheckForNull;
023 import javax.annotation.Nullable;
024
025 public class Metric extends Model {
026
027 private String key;
028 private String name;
029 private Integer direction;
030 private String domain;
031 private String description;
032 private String type;
033 private Boolean userManaged;
034 private Boolean hidden;
035
036 @CheckForNull
037 public String getKey() {
038 return key;
039 }
040
041 public Metric setKey(@Nullable String key) {
042 this.key = key;
043 return this;
044 }
045
046 @CheckForNull
047 public String getName() {
048 return name;
049 }
050
051 public Metric setName(@Nullable String name) {
052 this.name = name;
053 return this;
054 }
055
056 @CheckForNull
057 public Integer getDirection() {
058 return direction;
059 }
060
061 public Metric setDirection(@Nullable Integer direction) {
062 this.direction = direction;
063 return this;
064 }
065
066 @CheckForNull
067 public String getDomain() {
068 return domain;
069 }
070
071 public Metric setDomain(@Nullable String domain) {
072 this.domain = domain;
073 return this;
074 }
075
076 @CheckForNull
077 public String getDescription() {
078 return description;
079 }
080
081 public Metric setDescription(@Nullable String description) {
082 this.description = description;
083 return this;
084 }
085
086 @CheckForNull
087 public String getType() {
088 return type;
089 }
090
091 public Metric setType(@Nullable String type) {
092 this.type = type;
093 return this;
094 }
095
096 @CheckForNull
097 public Boolean getHidden() {
098 return hidden;
099 }
100
101 public Metric setHidden(@Nullable Boolean hidden) {
102 this.hidden = hidden;
103 return this;
104 }
105
106 @CheckForNull
107 public Boolean getUserManaged() {
108 return userManaged;
109 }
110
111 public Metric setUserManaged(@Nullable Boolean userManaged) {
112 this.userManaged = userManaged;
113 return this;
114 }
115
116 @Override
117 public String toString() {
118 return new StringBuilder()
119 .append(name)
120 .append("(")
121 .append(key)
122 .append(")")
123 .toString();
124 }
125 }