• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017. Uber Technologies
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 package com.uber.nullaway.testlibrarymodels;
17 
18 import static com.uber.nullaway.LibraryModels.MethodRef.methodRef;
19 
20 import com.google.auto.service.AutoService;
21 import com.google.common.collect.ImmutableSet;
22 import com.google.common.collect.ImmutableSetMultimap;
23 import com.uber.nullaway.LibraryModels;
24 
25 @AutoService(LibraryModels.class)
26 public class TestLibraryModels implements LibraryModels {
27 
28   @Override
failIfNullParameters()29   public ImmutableSetMultimap<MethodRef, Integer> failIfNullParameters() {
30     return ImmutableSetMultimap.of();
31   }
32 
33   @Override
explicitlyNullableParameters()34   public ImmutableSetMultimap<MethodRef, Integer> explicitlyNullableParameters() {
35     return ImmutableSetMultimap.of();
36   }
37 
38   @Override
nonNullParameters()39   public ImmutableSetMultimap<MethodRef, Integer> nonNullParameters() {
40     return new ImmutableSetMultimap.Builder<MethodRef, Integer>()
41         .put(
42             methodRef(
43                 "com.uber.lib.unannotated.RestrictivelyAnnotatedFIWithModelOverride",
44                 "apply(java.lang.Object)"),
45             0)
46         .build();
47   }
48 
49   @Override
nullImpliesTrueParameters()50   public ImmutableSetMultimap<MethodRef, Integer> nullImpliesTrueParameters() {
51     return ImmutableSetMultimap.of();
52   }
53 
54   @Override
nullImpliesFalseParameters()55   public ImmutableSetMultimap<MethodRef, Integer> nullImpliesFalseParameters() {
56     return ImmutableSetMultimap.of();
57   }
58 
59   @Override
nullImpliesNullParameters()60   public ImmutableSetMultimap<MethodRef, Integer> nullImpliesNullParameters() {
61     return ImmutableSetMultimap.of();
62   }
63 
64   @Override
nullableReturns()65   public ImmutableSet<MethodRef> nullableReturns() {
66     return ImmutableSet.of();
67   }
68 
69   @Override
nonNullReturns()70   public ImmutableSet<MethodRef> nonNullReturns() {
71     return ImmutableSet.of();
72   }
73 }
74