# MtpObjectInfo.Builder

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

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/mtp/MtpObjectInfo.Builder "View this page in Java")  

```
class Builder
```

|---|------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                         ||
| ↳ | [android.mtp.MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#) |

Builds a new object info instance.

## Summary

|                                                                                                                                           Public constructors                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#Builder())`()` <br />                                                                                                                                                                                     |
| [Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#Builder(android.mtp.MtpObjectInfo))`(`objectInfo:` `[MtpObjectInfo](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo)!`)` Creates a builder on a copy of an existing object info. |

|                                                                                                                                                                          Public methods                                                                                                                                                                           ||
|-----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[MtpObjectInfo](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo)!                  | [build](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#build())`()` Builds the object info instance.                                                                                                           |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setAssociationDesc](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setAssociationDesc(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />            |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setAssociationType](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setAssociationType(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />            |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setCompressedSize](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setCompressedSize(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br />           |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setDateCreated](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setDateCreated(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br />                 |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setDateModified](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setDateModified(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br />               |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setFormat](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setFormat(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                              |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setImagePixDepth](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setImagePixDepth(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br />             |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setImagePixHeight](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setImagePixHeight(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br />           |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setImagePixWidth](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setImagePixWidth(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br />             |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setKeywords](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setKeywords(kotlin.String))`(`value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` <br />                 |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setName](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setName(kotlin.String))`(`value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` <br />                         |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setObjectHandle](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setObjectHandle(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                  |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setParent](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setParent(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                              |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setProtectionStatus](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setProtectionStatus(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />          |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setSequenceNumber](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setSequenceNumber(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br />           |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setStorageId](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setStorageId(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                        |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setThumbCompressedSize](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setThumbCompressedSize(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setThumbFormat](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setThumbFormat(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                    |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setThumbPixHeight](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setThumbPixHeight(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br />           |
| open[MtpObjectInfo.Builder](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#)! | [setThumbPixWidth](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo.Builder#setThumbPixWidth(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br />             |

## Public constructors

### Builder

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

```
Builder()
```  

### Builder

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

```
Builder(objectInfo: MtpObjectInfo!)
```

Creates a builder on a copy of an existing object info. All fields, except the object handle will be copied.

|                                                                Parameters                                                                 ||
|--------------|-----------------------------------------------------------------------------------------------------------------------------|
| `objectInfo` | [MtpObjectInfo](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo)!:object info of an existing entry |

## Public methods

### build

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

```
open fun build(): MtpObjectInfo!
```

Builds the object info instance. Once called, methods of the builder must not be called anymore.

|                                                                               Return                                                                                ||
|--------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| [MtpObjectInfo](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo)! | the object info of the newly created file, or NULL in case of an error. |

### setAssociationDesc

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

```
open fun setAssociationDesc(value: Int): MtpObjectInfo.Builder!
```  

### setAssociationType

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

```
open fun setAssociationType(value: Int): MtpObjectInfo.Builder!
```  

### setCompressedSize

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

```
open fun setCompressedSize(value: Long): MtpObjectInfo.Builder!
```  

### setDateCreated

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

```
open fun setDateCreated(value: Long): MtpObjectInfo.Builder!
```  

### setDateModified

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

```
open fun setDateModified(value: Long): MtpObjectInfo.Builder!
```  

### setFormat

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

```
open fun setFormat(value: Int): MtpObjectInfo.Builder!
```  

### setImagePixDepth

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

```
open fun setImagePixDepth(value: Long): MtpObjectInfo.Builder!
```  

### setImagePixHeight

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

```
open fun setImagePixHeight(value: Long): MtpObjectInfo.Builder!
```  

### setImagePixWidth

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

```
open fun setImagePixWidth(value: Long): MtpObjectInfo.Builder!
```  

### setKeywords

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

```
open fun setKeywords(value: String): MtpObjectInfo.Builder!
```

|                                                      Parameters                                                       ||
|---------|--------------------------------------------------------------------------------------------------------------|
| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

### setName

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

```
open fun setName(value: String): MtpObjectInfo.Builder!
```

|                                                      Parameters                                                       ||
|---------|--------------------------------------------------------------------------------------------------------------|
| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

### setObjectHandle

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

```
open fun setObjectHandle(value: Int): MtpObjectInfo.Builder!
```  

### setParent

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

```
open fun setParent(value: Int): MtpObjectInfo.Builder!
```  

### setProtectionStatus

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

```
open fun setProtectionStatus(value: Int): MtpObjectInfo.Builder!
```  

### setSequenceNumber

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

```
open fun setSequenceNumber(value: Long): MtpObjectInfo.Builder!
```  

### setStorageId

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

```
open fun setStorageId(value: Int): MtpObjectInfo.Builder!
```  

### setThumbCompressedSize

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

```
open fun setThumbCompressedSize(value: Long): MtpObjectInfo.Builder!
```  

### setThumbFormat

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

```
open fun setThumbFormat(value: Int): MtpObjectInfo.Builder!
```  

### setThumbPixHeight

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

```
open fun setThumbPixHeight(value: Long): MtpObjectInfo.Builder!
```  

### setThumbPixWidth

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

```
open fun setThumbPixWidth(value: Long): MtpObjectInfo.Builder!
```