1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.tools.metalava.reporter 18 19 /** 20 * An object for which issues can be reported. 21 * 22 * There are two forms of location provided here. The location in the source file, i.e. 23 * [fileLocation], and the baseline key used to track known issues, i.e. [baselineKey]. 24 * 25 * The source location is optional as it is not always available, see [FileLocation] for more 26 * information. 27 * 28 * The baseline key identifies an API element, for the purposes of tracking known issues. The source 29 * location is not used for that as it will change quite frequently as the code is modified and the 30 * baseline key needs to identify the same API component over a long period of time. 31 * 32 * See [Reporter] for more details. 33 */ 34 interface Reportable { 35 /** The file location for this object. */ 36 val fileLocation: FileLocation 37 38 /** The [BaselineKey] that is used to suppress issues on this. */ 39 val baselineKey: BaselineKey 40 41 /** 42 * Get the set of suppressed issues for this. 43 * 44 * Each value could be just the name of an issue in which case all issues of that type are 45 * suppressed. Or, it could be the name of the issue followed by ":" or ": " and the full 46 * message in which case only the issue with that specific message is suppressed. 47 */ suppressedIssuesnull48 fun suppressedIssues(): Set<String> 49 } 50