org.apache.logging.log4j.core.config.plugins.convert
Interface TypeConverter<T>

Type Parameters:
T - Converts Strings into the given type T.
All Known Implementing Classes:
EnumConverter, TypeConverters.BigDecimalConverter, TypeConverters.BigIntegerConverter, TypeConverters.BooleanConverter, TypeConverters.ByteArrayConverter, TypeConverters.ByteConverter, TypeConverters.CharacterConverter, TypeConverters.CharArrayConverter, TypeConverters.CharsetConverter, TypeConverters.ClassConverter, TypeConverters.DoubleConverter, TypeConverters.FileConverter, TypeConverters.FloatConverter, TypeConverters.IntegerConverter, TypeConverters.LevelConverter, TypeConverters.LongConverter, TypeConverters.PatternConverter, TypeConverters.SecurityProviderConverter, TypeConverters.ShortConverter, TypeConverters.StringConverter, TypeConverters.UriConverter, TypeConverters.UrlConverter

public interface TypeConverter<T>

Interface for doing automatic String conversion to a specific type.

Since:
2.1 Moved to the convert package.

Method Summary
 T convert(String s)
          Converts a String to a given type.
 

Method Detail

convert

T convert(String s)
          throws Exception
Converts a String to a given type.

Parameters:
s - the String to convert. Cannot be null.
Returns:
the converted object.
Throws:
Exception - thrown when a conversion error occurs


Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.