001/* 002 * SonarQube 003 * Copyright (C) 2009-2016 SonarSource SA 004 * mailto:contact AT sonarsource DOT com 005 * 006 * This program 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 * This program 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 */ 020package org.sonar.api.ce.measure; 021 022/** 023 * Measure used in {@link MeasureComputer} 024 * 025 * @since 5.2 026 */ 027public interface Measure { 028 029 /** 030 * The value of this measure as a integer. 031 * 032 * @throws IllegalStateException if the value type of the metric is not a integer. See {@link org.sonar.api.measures.Metric.ValueType} 033 */ 034 int getIntValue(); 035 036 /** 037 * The value of this measure as a long. 038 * 039 * @throws IllegalStateException if the value type of the metric is not a long. See {@link org.sonar.api.measures.Metric.ValueType} 040 */ 041 long getLongValue(); 042 043 /** 044 * The value of this measure as a double. 045 * 046 * @throws IllegalStateException if the value type of the metric is not a double. See {@link org.sonar.api.measures.Metric.ValueType} 047 */ 048 double getDoubleValue(); 049 050 /** 051 * The value of this measure as a string. 052 * 053 * @throws IllegalStateException if the value type of the metric is not a string. See {@link org.sonar.api.measures.Metric.ValueType} 054 */ 055 String getStringValue(); 056 057 /** 058 * The value of this measure as a boolean. 059 * 060 * @throws IllegalStateException if the value type of the metric is not a boolean. See {@link org.sonar.api.measures.Metric.ValueType} 061 */ 062 boolean getBooleanValue(); 063 064}