001/*
002 * SonarQube
003 * Copyright (C) 2009-2017 SonarSource SA
004 * mailto:info 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.batch.postjob.issue;
021
022import javax.annotation.CheckForNull;
023import org.sonar.api.batch.fs.InputComponent;
024import org.sonar.api.batch.rule.Severity;
025import org.sonar.api.rule.RuleKey;
026
027/**
028 * Represents an issue state at the end of the scanner analysis in preview/issues mode.
029 *
030 * @since 5.2
031 */
032public interface PostJobIssue {
033
034  /**
035   * Key of the issue.
036   */
037  String key();
038
039  /**
040   * The {@link RuleKey} of this issue.
041   */
042  RuleKey ruleKey();
043
044  /**
045   * Component key like foo:src/Foo.php
046   */
047  String componentKey();
048
049  /**
050   * The {@link InputComponent} this issue belongs to. Returns null if component was deleted (for resolved issues).
051   */
052  @CheckForNull
053  InputComponent inputComponent();
054
055  /**
056   * Line of the issue. Null for global issues and issues on directories. Can also be null
057   * for files (issue global to the file).
058   */
059  @CheckForNull
060  Integer line();
061
062  /**
063   * Message of the issue.
064   */
065  @CheckForNull
066  String message();
067
068  /**
069   * Severity.
070   */
071  Severity severity();
072
073  /**
074   * If the issue a new one.
075   */
076  boolean isNew();
077
078}