Debian Codegraph @

core/java/android/accounts/AccountAndUser.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2012 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 android.accounts;
18
19 import android.annotation.Nullable;
20 import android.compat.annotation.UnsupportedAppUsage;
21
22 /**
23 * Used to store the Account and the UserId this account is associated with.
24 *
25 * @hide
26 */
27 public class AccountAndUser {
28 @UnsupportedAppUsage
29 public Account account;
30 @UnsupportedAppUsage
31 public int userId;
32
33 @UnsupportedAppUsage
34 public AccountAndUser(Account account, int userId) {
35 this.account = account;
36 this.userId = userId;
37 }
38
39 public boolean equals(@Nullable Object o) {
40 if (this == o) return true;
41 if (!(o instanceof AccountAndUser)) return false;
42 final AccountAndUser other = (AccountAndUser) o;
43 return this.account.equals(other.account)
44 && this.userId == other.userId;
45 }
46
47 @Override
48 public int hashCode() {
49 return account.hashCode() + userId;
50 }
51
52 public String toString() {
53 return account.toString() + " u" + userId;
54 }
55 }