T - Type of Collection such as List, Setpublic abstract class CollectionConfig<T extends CollectionConfig> extends Object implements IdentifiedDataSerializable
| 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).
|
boolean |
equals(Object o) |
protected String |
fieldsToString()
Returns field names with values as concatenated String so it can be used in child classes' toString() methods.
|
abstract T |
getAsReadOnly() |
int |
getAsyncBackupCount()
Gets the number of asynchronous backups.
|
int |
getBackupCount()
Gets the number of synchronous backups for this collection.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
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.
|
int |
hashCode() |
boolean |
isStatisticsEnabled()
Checks if collection statistics are enabled.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
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.
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetIdpublic 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 collectionpublic List<ItemListenerConfig> getItemListenerConfigs()
public T setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)
listenerConfigs - the list of ItemListenerConfigs to setpublic int getTotalBackupCount()
public int getBackupCount()
public T setBackupCount(int backupCount)
backupCount - the number of synchronous backups to set for this collectionIllegalArgumentException - 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()
true if collection statistics are enabled, false otherwisepublic T setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled - true to enable collection statistics, false to disablepublic void addItemListenerConfig(ItemListenerConfig itemListenerConfig)
itemListenerConfig - the item listener to add to this collectionpublic int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - outputIOExceptionpublic void readData(ObjectDataInput in) throws IOException
DataSerializablereadData in interface DataSerializablein - inputIOExceptionprotected String fieldsToString()
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.