1 /*
2  * Copyright (C) 2018 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.dialer.simulator.impl;
18 
19 import com.google.auto.value.AutoValue;
20 import com.google.common.collect.ImmutableMap;
21 import java.util.Collections;
22 import java.util.Map;
23 
24 /** Represents a portal that receives requests from either UI or IPC. */
25 @AutoValue
26 public abstract class SimulatorPortalEntryGroup {
methods()27   abstract ImmutableMap<String, Runnable> methods();
28 
subPortals()29   abstract ImmutableMap<String, SimulatorPortalEntryGroup> subPortals();
30 
builder()31   static Builder builder() {
32     return new AutoValue_SimulatorPortalEntryGroup.Builder()
33         .setMethods(Collections.emptyMap())
34         .setSubPortals(Collections.emptyMap());
35   }
36 
37   @AutoValue.Builder
38   abstract static class Builder {
setMethods(Map<String, Runnable> value)39     abstract Builder setMethods(Map<String, Runnable> value);
40 
setSubPortals(Map<String, SimulatorPortalEntryGroup> value)41     abstract Builder setSubPortals(Map<String, SimulatorPortalEntryGroup> value);
42 
build()43     abstract SimulatorPortalEntryGroup build();
44   }
45 }
46