• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2013 Google LLC
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.google.auto.factory.processor;
17 
18 import com.google.auto.value.AutoValue;
19 import com.google.common.collect.ImmutableSet;
20 import javax.lang.model.type.TypeMirror;
21 
22 @AutoValue
23 abstract class ImplementationMethodDescriptor {
name()24   abstract String name();
25 
returnType()26   abstract TypeMirror returnType();
27 
publicMethod()28   abstract boolean publicMethod();
29 
passedParameters()30   abstract ImmutableSet<Parameter> passedParameters();
31 
isVarArgs()32   abstract boolean isVarArgs();
33 
exceptions()34   abstract ImmutableSet<TypeMirror> exceptions();
35 
builder()36   static Builder builder() {
37     return new AutoValue_ImplementationMethodDescriptor.Builder();
38   }
39 
40   @AutoValue.Builder
41   abstract static class Builder {
name(String name)42     abstract Builder name(String name);
43 
returnType(TypeMirror returnTypeElement)44     abstract Builder returnType(TypeMirror returnTypeElement);
45 
publicMethod(boolean publicMethod)46     abstract Builder publicMethod(boolean publicMethod);
47 
publicMethod()48     final Builder publicMethod() {
49       return publicMethod(true);
50     }
51 
passedParameters(Iterable<Parameter> passedParameters)52     abstract Builder passedParameters(Iterable<Parameter> passedParameters);
53 
isVarArgs(boolean isVarargs)54     abstract Builder isVarArgs(boolean isVarargs);
55 
exceptions(Iterable<? extends TypeMirror> exceptions)56     abstract Builder exceptions(Iterable<? extends TypeMirror> exceptions);
57 
build()58     abstract ImplementationMethodDescriptor build();
59   }
60 }
61