net.relaysoft.commons.data.TextDataImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of data-manager Show documentation
Show all versions of data-manager Show documentation
Data management utility project
package net.relaysoft.commons.data;
import net.relaysoft.commons.data.enums.DataTypeEnum;
import net.relaysoft.commons.data.manager.DataManager;
/**
* Default text data implementation.
*
* @author relaysoft.net
*
*/
public class TextDataImpl extends AbstractData implements TextData {
/**
* Create new text data with default meta data.
*
* @param dataManager - Data manager instance which is handling the data content
*/
public TextDataImpl(DataManager dataManager) {
this(DataID.create(dataManager.getInstanceId(), DataTypeEnum.TEXT), dataManager);
}
/**
* Create new text data from existing data ID with default meta data.
*
* @param dataID - Data ID
* @param dataManager - Data manager instance which is handling the data content
* @throws IllegalArgumentException If data ID's data type does not match byte data.
*/
public TextDataImpl(DataID dataID, DataManager dataManager) {
this(dataID, dataManager, new MetaDataImpl());
}
/**
* Create new text data.
*
* @param dataManager - Data manager instance which is handling the data content
* @param metaData - Initial meta data instance for the data
*/
public TextDataImpl(DataManager dataManager, MetaData metaData){
this(DataID.create(dataManager.getInstanceId(), DataTypeEnum.TEXT), dataManager, metaData);
}
/**
* Create new text data instance from existing data ID.
*
* @param dataID - Data ID
* @param dataManager - Data manager instance which is handling the data content
* @param metaData - Initial meta data instance for the data
* @throws IllegalArgumentException If data ID's data type does not match byte data.
*/
public TextDataImpl(DataID dataID, DataManager dataManager, MetaData metaData){
super(dataID, dataManager, metaData);
}
@Override
protected DataTypeEnum getControlDataType() {
return DataTypeEnum.TEXT;
}
}