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

io.rtdi.bigdata.connector.properties.atomic.PropertyString Maven / Gradle / Ivy

There is a newer version: 0.10.20
Show newest version
package io.rtdi.bigdata.connector.properties.atomic;

import io.rtdi.bigdata.connector.pipeline.foundation.exceptions.PropertiesException;

public class PropertyString extends PropertyAbstract implements IPropertyValue {
	protected String value;

	public PropertyString() {
		super();
	}
	
	public PropertyString(String name, String value) {
		this(name, null, null, null, value, null);
	}
	
	public PropertyString(String name, String displayname, String description, String icon, String defaultvalue, Boolean mandatory) {
		super(name, displayname, description, icon, mandatory);
		setValue(defaultvalue);
	}

	public void setValue(String value) {
		this.value = value;
	}

	@Override
	public String getValue() {
		return value;
	}

	@Override
	public void parseValue(IProperty property, boolean ignorepasswords) throws PropertiesException {
		if (property instanceof PropertyString) {
			this.value = ((PropertyString) property).getValue();
		} else {
			throw new PropertiesException("PropertyString's value not of type PropertyString");
		}
	}

	@Override
	public String toString() {
		return value;
	}

	@Override
	public boolean hasValue() {
		return value != null && value.length() != 0;
	}

	@Override
	public IProperty clone(boolean ignorepasswords) {
		return new PropertyString(this.getName(), this.getDisplayname(), this.getDescription(), this.getIcon(), this.getValue(), this.getMandatory());
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy