Package it.ernytech.tdlib

## Class TdApi.TdlibParameters

- java.lang.Object
- - it.ernytech.tdlib.TdApi.Object
  - - it.ernytech.tdlib.TdApi.TdlibParameters

Enclosing class:
  TdApi

    public static class TdApi.TdlibParameters
    extends TdApi.Object

Contains parameters for TDLib initialization.

### Field Summary

Fields
`java.lang.String` `apiHash` Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org.
`int` `apiId` Application identifier for Telegram API access, which can be obtained at https://my.telegram.org.
`java.lang.String` `applicationVersion` Application version; must be non-empty.
`static int` `CONSTRUCTOR` Identifier uniquely determining type of the object.
`java.lang.String` `databaseDirectory` The path to the directory for the persistent database; if empty, the current working directory will be used.
`java.lang.String` `deviceModel` Model of the device the application is being run on; must be non-empty.
`boolean` `enableStorageOptimizer` If set to true, old files will automatically be deleted.
`java.lang.String` `filesDirectory` The path to the directory for storing files; if empty, databaseDirectory will be used.
`boolean` `ignoreFileNames` If set to true, original file names will be ignored.
`java.lang.String` `systemLanguageCode` IETF language tag of the user's operating system language; must be non-empty.
`java.lang.String` `systemVersion` Version of the operating system the application is being run on; must be non-empty.
`boolean` `useChatInfoDatabase` If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats.
`boolean` `useFileDatabase` If set to true, information about downloaded and uploaded files will be saved between application restarts.
`boolean` `useMessageDatabase` If set to true, the library will maintain a cache of chats and messages.
`boolean` `useSecretChats` If set to true, support for secret chats will be enabled.
`boolean` `useTestDc` If set to true, the Telegram test environment will be used instead of the production environment.

### Constructor Summary

Constructors
`TdlibParameters()` Default constructor.

`TdlibParameters​(boolean useTestDc, java.lang.String databaseDirectory, java.lang.String filesDirectory, boolean useFileDatabase, boolean useChatInfoDatabase, boolean useMessageDatabase, boolean useSecretChats, int apiId, java.lang.String apiHash, java.lang.String systemLanguageCode, java.lang.String deviceModel, java.lang.String systemVersion, java.lang.String applicationVersion, boolean enableStorageOptimizer, boolean ignoreFileNames)`

Constructor for initialization of all fields.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getConstructor()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from class it.ernytech.tdlib.TdApi.Object

`toString`

### Field Detail

#### useTestDc

    public boolean useTestDc

If set to true, the Telegram test environment will be used instead of the production environment.

#### databaseDirectory

    public java.lang.String databaseDirectory

The path to the directory for the persistent database; if empty, the current working directory will be used.

#### filesDirectory

    public java.lang.String filesDirectory

The path to the directory for storing files; if empty, databaseDirectory will be used.

#### useFileDatabase

    public boolean useFileDatabase

If set to true, information about downloaded and uploaded files will be saved between application restarts.

#### useChatInfoDatabase

    public boolean useChatInfoDatabase

If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies useFileDatabase.

#### useMessageDatabase

    public boolean useMessageDatabase

If set to true, the library will maintain a cache of chats and messages. Implies useChatInfoDatabase.

#### useSecretChats

    public boolean useSecretChats

If set to true, support for secret chats will be enabled.

#### apiId

    public int apiId

Application identifier for Telegram API access, which can be obtained at https://my.telegram.org.

#### apiHash

    public java.lang.String apiHash

Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org.

#### systemLanguageCode

    public java.lang.String systemLanguageCode

IETF language tag of the user's operating system language; must be non-empty.

#### deviceModel

    public java.lang.String deviceModel

Model of the device the application is being run on; must be non-empty.

#### systemVersion

    public java.lang.String systemVersion

Version of the operating system the application is being run on; must be non-empty.

#### applicationVersion

    public java.lang.String applicationVersion

Application version; must be non-empty.

#### enableStorageOptimizer

    public boolean enableStorageOptimizer

If set to true, old files will automatically be deleted.

#### ignoreFileNames

    public boolean ignoreFileNames

If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name.

#### CONSTRUCTOR

    public static final int CONSTRUCTOR

Identifier uniquely determining type of the object.

See Also:
  Constant Field Values

### Constructor Detail

#### TdlibParameters

    public TdlibParameters()

Default constructor.

#### TdlibParameters

    public TdlibParameters​(boolean useTestDc,
                           java.lang.String databaseDirectory,
                           java.lang.String filesDirectory,
                           boolean useFileDatabase,
                           boolean useChatInfoDatabase,
                           boolean useMessageDatabase,
                           boolean useSecretChats,
                           int apiId,
                           java.lang.String apiHash,
                           java.lang.String systemLanguageCode,
                           java.lang.String deviceModel,
                           java.lang.String systemVersion,
                           java.lang.String applicationVersion,
                           boolean enableStorageOptimizer,
                           boolean ignoreFileNames)

Constructor for initialization of all fields.

Parameters:
  `useTestDc` - If set to true, the Telegram test environment will be used instead of the production environment.
  `databaseDirectory` - The path to the directory for the persistent database; if empty, the current working directory will be used.
  `filesDirectory` - The path to the directory for storing files; if empty, databaseDirectory will be used.
  `useFileDatabase` - If set to true, information about downloaded and uploaded files will be saved between application restarts.
  `useChatInfoDatabase` - If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies useFileDatabase.
  `useMessageDatabase` - If set to true, the library will maintain a cache of chats and messages. Implies useChatInfoDatabase.
  `useSecretChats` - If set to true, support for secret chats will be enabled.
  `apiId` - Application identifier for Telegram API access, which can be obtained at https://my.telegram.org.
  `apiHash` - Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org.
  `systemLanguageCode` - IETF language tag of the user's operating system language; must be non-empty.
  `deviceModel` - Model of the device the application is being run on; must be non-empty.
  `systemVersion` - Version of the operating system the application is being run on; must be non-empty.
  `applicationVersion` - Application version; must be non-empty.
  `enableStorageOptimizer` - If set to true, old files will automatically be deleted.
  `ignoreFileNames` - If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name.

### Method Detail

#### getConstructor

    public int getConstructor()

Specified by:
  `getConstructor` in class `TdApi.Object`
Returns:
  this.CONSTRUCTOR