net.sf.mmm.util.value.impl.ValueConverterToEnum Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mmm-util-pojo Show documentation
Show all versions of mmm-util-pojo Show documentation
This project provides common utitlities to for POJOs.
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.value.impl;
import java.util.Locale;
import javax.inject.Named;
import javax.inject.Singleton;
import net.sf.mmm.util.lang.api.StringUtil;
import net.sf.mmm.util.lang.base.StringUtilImpl;
import net.sf.mmm.util.value.base.AbstractSimpleValueConverter;
/**
* This is an implementation of the {@link net.sf.mmm.util.value.api.ValueConverter} interface that converts an
* {@link Object} to an {@link Enum}. It supports objects given as {@link CharSequence} (e.g. {@link String}) or
* {@link Number} as well as an {@link Enum} having an value with the same {@link Enum#name() name}.
*
* @author Joerg Hohwiller (hohwille at users.sourceforge.net)
* @since 1.0.1
*/
@Singleton
@Named
@SuppressWarnings({ "unchecked", "rawtypes" })
public class ValueConverterToEnum extends AbstractSimpleValueConverter
© 2015 - 2024 Weber Informatics LLC | Privacy Policy