T
- Type of Collection such as List, Setpublic abstract class CollectionConfig<T extends CollectionConfig> extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ASYNC_BACKUP_COUNT
The default number of asynchronous backups
|
static int |
DEFAULT_MAX_SIZE
Default maximum size for the Configuration.
|
static int |
DEFAULT_SYNC_BACKUP_COUNT
The default number of synchronous backups
|
Modifier | Constructor and Description |
---|---|
protected |
CollectionConfig() |
protected |
CollectionConfig(CollectionConfig config) |
Modifier and Type | Method and Description |
---|---|
void |
addItemListenerConfig(ItemListenerConfig itemListenerConfig)
Adds an item listener to this collection (listens for when items are added or removed).
|
abstract T |
getAsReadOnly() |
int |
getAsyncBackupCount()
Gets the number of asynchronous backups.
|
int |
getBackupCount()
Gets the number of synchronous backups for this collection.
|
List<ItemListenerConfig> |
getItemListenerConfigs()
Gets the list of ItemListenerConfigs.
|
int |
getMaxSize()
Gets the maximum size for the Configuration.
|
String |
getName()
Gets the name of this collection.
|
int |
getTotalBackupCount()
Gets the total number of synchronous and asynchronous backups for this collection.
|
boolean |
isStatisticsEnabled()
Checks if collection statistics are enabled.
|
T |
setAsyncBackupCount(int asyncBackupCount)
Sets the number of asynchronous backups.
|
T |
setBackupCount(int backupCount)
Sets the number of synchronous backups for this collection.
|
T |
setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)
Sets the list of ItemListenerConfigs.
|
T |
setMaxSize(int maxSize)
Sets the maximum size for the collection.
|
T |
setName(String name)
Sets the name of this collection.
|
T |
setStatisticsEnabled(boolean statisticsEnabled)
Sets collection statistics to enabled or disabled.
|
public static final int DEFAULT_MAX_SIZE
public static final int DEFAULT_SYNC_BACKUP_COUNT
public static final int DEFAULT_ASYNC_BACKUP_COUNT
protected CollectionConfig()
protected CollectionConfig(CollectionConfig config)
public abstract T getAsReadOnly()
public String getName()
public T setName(String name)
name
- The name of this collection.public List<ItemListenerConfig> getItemListenerConfigs()
public T setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)
listenerConfigs
- The list of ItemListenerConfigs to set.public int getTotalBackupCount()
public int getBackupCount()
public T setBackupCount(int backupCount)
backupCount
- the number of synchronous backups to set for this collection.IllegalArgumentException
- if backupCount smaller than 0,
or larger than the maximum number of backup
or the sum of the backups and async backups is larger than the maximum number of backupssetAsyncBackupCount(int)
public int getAsyncBackupCount()
public T setAsyncBackupCount(int asyncBackupCount)
asyncBackupCount
- the number of asynchronous synchronous backups to setIllegalArgumentException
- if asyncBackupCount is smaller than 0,
or larger than the maximum number of backups,
or the sum of the backups and async backups is larger than the maximum number of backups.setBackupCount(int)
,
getAsyncBackupCount()
public int getMaxSize()
public T setMaxSize(int maxSize)
public boolean isStatisticsEnabled()
public T setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled
- True to enable collection statistics, false to disable.public void addItemListenerConfig(ItemListenerConfig itemListenerConfig)
itemListenerConfig
- The item listener to add to this collection.Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.