1 /* 2 * Copyright 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 androidx.xr.runtime 18 19 import kotlin.time.ComparableTimeMark 20 21 /** 22 * Represents the state of the XR system at a specific point in time. 23 * 24 * Instances of this class can be accessed via the [Session.state] [StateFlow] property. This class 25 * may include extension properties provided by implementations of the [StateExtender] interface 26 * found during [Session] creation. 27 * 28 * @property timeMark at which the state was computed. 29 */ 30 public class CoreState(public val timeMark: ComparableTimeMark) { 31 equalsnull32 override fun equals(other: Any?): Boolean { 33 if (this === other) return true 34 if (other !is CoreState) return false 35 if (timeMark != other.timeMark) return false 36 return true 37 } 38 hashCodenull39 override fun hashCode(): Int = timeMark.hashCode() 40 41 override fun toString(): String = "CoreState(timeMark=$timeMark)" 42 } 43