package com.hammurapi.convert;

/**
 * Base class for atomic converters.
 * @author Pavel
 *
 */
public abstract class AtomicConverterBase<S, T> implements AtomicConverter<S, T> {

	protected Class<S> sourceType;
	protected Class<T> targetType;

	public Class<S> getSourceType() {
		return sourceType;
	}

	public Class<T> getTargetType() {
		return targetType;
	}

	public AtomicConverterBase(Class<S> sourceType, Class<T> targetType) {
		super();
		this.sourceType = sourceType;
		this.targetType = targetType;
	}

	public String toString() {
		return "AtomicConverter of "+sourceType+" (loaded by "+sourceType.getClassLoader()+") to "+targetType+" (loaded by "+targetType.getClassLoader()+")";
	}
}
