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

net.anotheria.anoprise.dataspace.attribute.BooleanAttribute Maven / Gradle / Ivy

Go to download

Collection of utils for different enterprise class projects. Among other stuff contains Caches, Mocking, DualCrud, MetaFactory and SessionDistributorService. Visit https://opensource.anotheria.net for details.

There is a newer version: 4.0.0
Show newest version
package net.anotheria.anoprise.dataspace.attribute;

/**
 * Boolean attribute used in dataspace.
 * 
 * @author abolbat
 */
public class BooleanAttribute extends Attribute {

	/**
	 * Basic serialVersionUID variable.
	 */
	private static final long serialVersionUID = 7580990463274456724L;

	/**
	 * Attribute long value.
	 */
	private boolean value;

	/**
	 * Default constructor.
	 * 
	 * @param aName
	 *            - attribute name
	 * @param aStringValue
	 *            - attribute value as string
	 */
	public BooleanAttribute(String aName, String aStringValue) {
		super(aName);
		this.value = Boolean.parseBoolean(aStringValue);
	}

	/**
	 * Default constructor.
	 * 
	 * @param aName
	 *            - attribute name
	 * @param aValue
	 *            - attribute value
	 */
	public BooleanAttribute(String aName, boolean aValue) {
		super(aName);
		this.value = aValue;
	}

	@Override
	public String getValueAsString() {
		return String.valueOf(value);
	}

	@Override
	public AttributeType getType() {
		return AttributeType.BOOLEAN;
	}

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

	public boolean getValue() {
		return value;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy