All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.relaysoft.commons.data.TextDataImpl Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
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;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy