1 /*
2  * Copyright (C) 2021 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 package com.android.server.uwb.data;
17 
18 import java.util.Arrays;
19 import java.util.Objects;
20 
21 public class UwbVendorUciResponse {
22     public byte status;
23     public byte[] payload;
24     public int gid;
25     public int oid;
26 
UwbVendorUciResponse(byte status, int gid, int oid, byte[] payload)27     public UwbVendorUciResponse(byte status, int gid, int oid, byte[] payload) {
28         this.status = status;
29         this.gid = gid;
30         this.oid = oid;
31         this.payload = payload;
32     }
33 
34     @Override
equals(Object o)35     public boolean equals(Object o) {
36         if (this == o) return true;
37         if (!(o instanceof UwbVendorUciResponse)) return false;
38         UwbVendorUciResponse that = (UwbVendorUciResponse) o;
39         return status == that.status && gid == that.gid && oid == that.oid
40                 && Arrays.equals(payload, that.payload);
41     }
42 
43     @Override
hashCode()44     public int hashCode() {
45         return Objects.hash(status, gid, oid, Arrays.hashCode(payload));
46     }
47 
48     @Override
toString()49     public String toString() {
50         return "UwbVendorUciResponse{"
51                 + "status=" + status
52                 + ", gid=" + gid
53                 + ", oid=" + oid
54                 + ", payload=" + Arrays.toString(payload)
55                 + '}';
56     }
57 }
58