# SurfaceEntityTester

Artifact: [androidx.xr.scenecore:scenecore-testing](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/testing/SurfaceEntityTester.kt+class:androidx.xr.scenecore.testing.SurfaceEntityTester) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
public final class SurfaceEntityTester
```

<br />

*** ** * ** ***

A test-only accessor for `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity` that enables direct manipulation and inspection of its internal state.

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SurfaceEntityTester#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SurfaceEntityTester#getPerceivedResolutionResult()()` Configures the perceived resolution of the entity, to be retrieved by `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity#getPerceivedResolution(androidx.xr.arcore.RenderViewpoint)`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/Surface.html` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SurfaceEntityTester#getSurface()()` The `https://developer.android.com/reference/android/view/Surface.html` used by the `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity`. |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SurfaceEntityTester#hashCode()()` |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SurfaceEntityTester#setPerceivedResolutionResult(androidx.xr.scenecore.PerceivedResolutionResult)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult value)` Configures the perceived resolution of the entity, to be retrieved by `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity#getPerceivedResolution(androidx.xr.arcore.RenderViewpoint)`. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SurfaceEntityTester#setSurface(android.view.Surface)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/Surface.html value)` The `https://developer.android.com/reference/android/view/Surface.html` used by the `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity`. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getPerceivedResolutionResult

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull PerceivedResolutionResult getPerceivedResolutionResult()
```

Configures the perceived resolution of the entity, to be retrieved by `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity#getPerceivedResolution(androidx.xr.arcore.RenderViewpoint)`.

Note: Unlike the real `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity#getPerceivedResolution(androidx.xr.arcore.RenderViewpoint)` method, the value returned by this getter is independent of any specific viewpoint or scene pose. It simply returns the last value that was set via this property.

### getSurface

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull Surface getSurface()
```

The `https://developer.android.com/reference/android/view/Surface.html` used by the `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity`.

Setting this property replaces the current `https://developer.android.com/reference/android/view/Surface.html` associated with the `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity`. In this testing implementation, the `https://developer.android.com/reference/android/view/Surface.html` can be set at any time and can be retrieved by calling `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity#getSurface()`. This allows tests to provide a specific `https://developer.android.com/reference/android/view/Surface.html` instance (such as one connected to a test-controlled producer) to verify rendering behavior.

### hashCode

```
public int hashCode()
```

### setPerceivedResolutionResult

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final void setPerceivedResolutionResult(@NonNull PerceivedResolutionResult value)
```

Configures the perceived resolution of the entity, to be retrieved by `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity#getPerceivedResolution(androidx.xr.arcore.RenderViewpoint)`.

Note: Unlike the real `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity#getPerceivedResolution(androidx.xr.arcore.RenderViewpoint)` method, the value returned by this getter is independent of any specific viewpoint or scene pose. It simply returns the last value that was set via this property.

### setSurface

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final void setSurface(@NonNull Surface value)
```

The `https://developer.android.com/reference/android/view/Surface.html` used by the `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity`.

Setting this property replaces the current `https://developer.android.com/reference/android/view/Surface.html` associated with the `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity`. In this testing implementation, the `https://developer.android.com/reference/android/view/Surface.html` can be set at any time and can be retrieved by calling `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity#getSurface()`. This allows tests to provide a specific `https://developer.android.com/reference/android/view/Surface.html` instance (such as one connected to a test-controlled producer) to verify rendering behavior.