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

pl.edu.icm.unity.stdext.attr.AbstractStringAttributeSyntax Maven / Gradle / Ivy

Go to download

Standard plugins which are distributed with the system: attribute syntaxes, identity types, credentials

There is a newer version: 4.0.2
Show newest version
/*
 * Copyright (c) 2013 ICM Uniwersytet Warszawski All rights reserved.
 * See LICENCE.txt file for licensing information.
 */
package pl.edu.icm.unity.stdext.attr;

import pl.edu.icm.unity.base.exceptions.InternalException;
import pl.edu.icm.unity.engine.api.attributes.AttributeValueSyntax;

/**
 * Common code for string based attribute syntax classes.
 * @author K. Benedyczak
 */
public abstract class AbstractStringAttributeSyntax implements AttributeValueSyntax
{
	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean areEqual(String value, Object another)
	{
		return value == null ? null == another : value.equals(another);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode(Object value)
	{
		return value.hashCode();
	}

	@Override
	public String serializeSimple(String value) throws InternalException
	{
		return value;
	}

	@Override
	public boolean isEmailVerifiable()
	{
		return false;
	}

	@Override
	public boolean isUserVerifiable()
	{
		return false;
	}

	@Override
	public String convertFromString(String stringRepresentation)
	{
		return stringRepresentation;
	}
	
	@Override
	public String convertToString(String value)
	{
		return value;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy