1 /*
2  * Copyright (C) 2024 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.ranging.generic.ranging;
18 
19 import com.google.auto.value.AutoValue;
20 import com.google.common.collect.ImmutableList;
21 
22 import java.util.Optional;
23 
24 /**
25  * Precision data represents both data received from ranging technologies and data from the fusion
26  * algorithm.
27  */
28 @AutoValue
29 public abstract class PrecisionData {
30 
31     /** Returns a list of {@link RangingData} for different ranging technologies if present. */
getRangingData()32     public abstract Optional<ImmutableList<RangingData>> getRangingData();
33 
34     /** Returns {@link FusionData} if present. */
getFusionData()35     public abstract Optional<FusionData> getFusionData();
36 
37     /** Returns the timestamp for this data. */
getTimestamp()38     public abstract long getTimestamp();
39 
40     /** Returns a builder for {@link RangingData}. */
builder()41     public static Builder builder() {
42         return new AutoValue_PrecisionData.Builder();
43     }
44 
45     /** Builder for {@link RangingData}. */
46     @AutoValue.Builder
47     public abstract static class Builder {
setRangingData(ImmutableList<RangingData> rangingData)48         public abstract Builder setRangingData(ImmutableList<RangingData> rangingData);
49 
setFusionData(FusionData fusionData)50         public abstract Builder setFusionData(FusionData fusionData);
51 
setTimestamp(long timestamp)52         public abstract Builder setTimestamp(long timestamp);
53 
build()54         public abstract PrecisionData build();
55     }
56 }