Class Converters
java.lang.Object
io.leandev.appfuse.converter.Converters
型別轉換器註冊表
管理和查詢各種型別轉換器的中央註冊表。 預設註冊了常用的基本型別轉換器。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TConverts a value to the specified target type.<T> Converter<T> Looks up a converter for the given target type.<T> voidRegisters a converter for a specific target type.
-
Constructor Details
-
Converters
public Converters()建立轉換器註冊表並註冊預設轉換器
-
-
Method Details
-
register
-
lookup
-
convert
Converts a value to the specified target type.- Type Parameters:
T- the target type- Parameters:
value- the value to converttargetType- the class of the target type- Returns:
- the converted value
- Throws:
ConversionException- if no converter is found or conversion fails
-