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.sonarqube.ws.client.issue;
021
022import com.google.common.base.Predicate;
023import com.google.common.collect.ImmutableList;
024import com.google.common.collect.Iterables;
025import java.util.List;
026
027/**
028 * @since 5.3
029 */
030public class IssueFilterParameters {
031
032  public static final String ISSUES = "issues";
033  public static final String SEVERITIES = "severities";
034  public static final String STATUSES = "statuses";
035  public static final String RESOLUTIONS = "resolutions";
036  public static final String RESOLVED = "resolved";
037  public static final String COMPONENTS = "components";
038  public static final String COMPONENT_KEYS = "componentKeys";
039  public static final String COMPONENT_UUIDS = "componentUuids";
040  public static final String COMPONENT_ROOTS = "componentRoots";
041  public static final String COMPONENT_ROOT_UUIDS = "componentRootUuids";
042  public static final String MODULE_UUIDS = "moduleUuids";
043  public static final String PROJECTS = "projects";
044  public static final String PROJECT_KEYS = "projectKeys";
045  public static final String PROJECT_UUIDS = "projectUuids";
046  public static final String DIRECTORIES = "directories";
047  public static final String FILE_UUIDS = "fileUuids";
048  public static final String ON_COMPONENT_ONLY = "onComponentOnly";
049  public static final String RULES = "rules";
050
051  /**
052   * @deprecated since 5.5, action plan feature has been removed
053   */
054  @Deprecated
055  public static final String DEPRECATED_ACTION_PLANS = "actionPlans";
056
057  /**
058   * @deprecated since 5.5, manual issue feature has been dropped.
059   */
060  @Deprecated
061  public static final String REPORTERS = "reporters";
062  public static final String ASSIGNEES = "assignees";
063  public static final String AUTHORS = "authors";
064  public static final String LANGUAGES = "languages";
065  public static final String TAGS = "tags";
066  public static final String TYPES = "types";
067  public static final String ASSIGNED = "assigned";
068
069  /**
070   * @deprecated since 5.5, action plan feature has been removed
071   */
072  @Deprecated
073  public static final String PLANNED = "planned";
074  public static final String HIDE_RULES = "hideRules";
075  public static final String HIDE_COMMENTS = "hideComments";
076  public static final String CREATED_AFTER = "createdAfter";
077  public static final String CREATED_AT = "createdAt";
078  public static final String CREATED_BEFORE = "createdBefore";
079  public static final String CREATED_IN_LAST = "createdInLast";
080  public static final String SINCE_LEAK_PERIOD = "sinceLeakPeriod";
081  public static final String PAGE_SIZE = "pageSize";
082  public static final String PAGE_INDEX = "pageIndex";
083  public static final String SORT = "sort";
084  public static final String ASC = "asc";
085  public static final String ADDITIONAL_FIELDS = "additionalFields";
086
087  public static final String FACET_MODE = "facetMode";
088  public static final String FACET_MODE_COUNT = "count";
089
090  /**
091   * @deprecated since 5.5, replaced by {@link #FACET_MODE_EFFORT}
092   */
093  @Deprecated
094  public static final String DEPRECATED_FACET_MODE_DEBT = "debt";
095  public static final String FACET_MODE_EFFORT = "effort";
096
097  public static final String FACET_ASSIGNED_TO_ME = "assigned_to_me";
098
099  public static final List<String> ALL = ImmutableList.of(ISSUES, SEVERITIES, STATUSES, RESOLUTIONS, RESOLVED,
100    COMPONENTS, COMPONENT_ROOTS, RULES, DEPRECATED_ACTION_PLANS, REPORTERS, TAGS, TYPES,
101    ASSIGNEES, LANGUAGES, ASSIGNED, PLANNED, HIDE_RULES, CREATED_AT, CREATED_AFTER, CREATED_BEFORE, CREATED_IN_LAST,
102    COMPONENT_UUIDS, COMPONENT_ROOT_UUIDS, FACET_MODE,
103    PROJECTS, PROJECT_UUIDS, PROJECT_KEYS, COMPONENT_KEYS, MODULE_UUIDS, DIRECTORIES, FILE_UUIDS, AUTHORS,
104    HIDE_COMMENTS, PAGE_SIZE, PAGE_INDEX, SORT, ASC);
105
106  public static final List<String> ALL_WITHOUT_PAGINATION = ImmutableList.copyOf(Iterables.filter(ALL, new Predicate<String>() {
107    @Override
108    public boolean apply(String input) {
109      return !PAGE_INDEX.equals(input) && !PAGE_SIZE.equals(input);
110    }
111  }));
112
113  private IssueFilterParameters() {
114    // Utility class
115  }
116}