Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/hardware/camera2/params/Capability#pubctors) \| [Methods](https://developer.android.com/reference/android/hardware/camera2/params/Capability#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/camera2/params/Capability#inhmethods)

# Capability

*** ** * ** ***

` public final class Capability `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.camera2.params.Capability |

<br />

*** ** * ** ***

Immutable class to store the camera capability, its corresponding maximum streaming dimension and zoom range.
**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES`

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/hardware/camera2/params/Capability#Capability(int,%20android.util.Size,%20android.util.Range<java.lang.Float>)(int mode, https://developer.android.com/reference/android/util/Size maxStreamingSize, https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Float> zoomRatioRange) ` Create a new Capability object. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/hardware/camera2/params/Capability#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Compare two Capability objects to see if they are equal. |
| ` https://developer.android.com/reference/android/util/Size` | ` https://developer.android.com/reference/android/hardware/camera2/params/Capability#getMaxStreamingSize()() ` Return the maximum streaming dimension of this capability. |
| ` int` | ` https://developer.android.com/reference/android/hardware/camera2/params/Capability#getMode()() ` Return the supported mode for this capability. |
| ` https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Float>` | ` https://developer.android.com/reference/android/hardware/camera2/params/Capability#getZoomRatioRange()() ` Return the zoom ratio range of this capability. |
| ` int` | ` https://developer.android.com/reference/android/hardware/camera2/params/Capability#hashCode()() ` Returns a hash code value for the object. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/hardware/camera2/params/Capability#toString()() ` Return the Capability as a string representation `"(mode:%d, maxStreamingSize:%d x %d, zoomRatio: %f-%f)"`. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Capability

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Capability (int mode, 
                Size maxStreamingSize, 
                Range<Float> zoomRatioRange)
```

Create a new Capability object.

The mode argument can be any integer value. maxStreamingWidth and maxStreamingHeight must be non-negative, while minZoomRatio and maxZoomRatio must be strictly positive.

This constructor is public to allow for easier application testing by creating custom object instances. It's not necessary to construct these objects during normal use of the camera API.

<br />

<br />

| Parameters ||
|---|---|
| `mode` | `int`: supported mode for a camera capability. <br /> |
| `maxStreamingSize` | `Size`: The maximum streaming size for this mode. This value cannot be `null`. <br /> |
| `zoomRatioRange` | `Range`: the minimum/maximum zoom ratio this mode supports. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if any of the arguments are not valid |

## Public methods

### equals

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object obj)
```

Compare two Capability objects to see if they are equal.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: Another Capability object <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the mode, max size and zoom ratio range are equal, `false` otherwise <br /> |

### getMaxStreamingSize

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Size getMaxStreamingSize ()
```

Return the maximum streaming dimension of this capability.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Size` | a new `https://developer.android.com/reference/android/util/Size` with non-negative width and height. This value cannot be `null`. <br /> |

### getMode

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMode ()
```

Return the supported mode for this capability.

<br />

| Returns ||
|---|---|
| `int` | One of supported modes for the capability. For example, for available extended scene modes, this will be one of `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#CONTROL_EXTENDED_SCENE_MODE_DISABLED`, `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE`, and `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS`. <br /> |

### getZoomRatioRange

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Range<Float> getZoomRatioRange ()
```

Return the zoom ratio range of this capability.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Float>` | The supported zoom ratio range supported by this capability. This value cannot be `null`. <br /> |

### hashCode

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### toString

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Return the Capability as a string representation `"(mode:%d, maxStreamingSize:%d x %d, zoomRatio: %f-%f)"`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | string representation of the capability and max streaming size. <br /> |