com.databasesandlife.util.wicket.CleartextPasswordConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-common Show documentation
Show all versions of java-common Show documentation
Utility classes developed at Adrian Smith Software (A.S.S.)
package com.databasesandlife.util.wicket;
import com.databasesandlife.util.gwtsafe.CleartextPassword;
import org.apache.wicket.util.convert.ConversionException;
import org.apache.wicket.util.convert.IConverter;
import java.util.Locale;
/**
* Wicket Converter for {@link CleartextPassword}.
*
* @author This source is copyright Adrian Smith and licensed under the LGPL 3.
* @see Project on GitHub
*/
public class CleartextPasswordConverter implements IConverter {
@Override public CleartextPassword convertToObject(String value, Locale locale)
throws ConversionException {
if (value == null) return null;
return new CleartextPassword(value);
}
@Override public String convertToString(CleartextPassword value, Locale locale) {
if (value == null) return null;
return value.getCleartext();
}
}