com.github.datalking.common.convert.editor.UUIDEditor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of play-mvc Show documentation
Show all versions of play-mvc Show documentation
simple mvc framework based on java servlet.
The newest version!
package com.github.datalking.common.convert.editor;
import com.github.datalking.util.StringUtils;
import java.beans.PropertyEditorSupport;
import java.util.UUID;
/**
*/
public class UUIDEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (StringUtils.hasText(text)) {
setValue(UUID.fromString(text));
}
else {
setValue(null);
}
}
@Override
public String getAsText() {
UUID value = (UUID) getValue();
return (value != null ? value.toString() : "");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy