Skip to content

ph typeconvert

Philip Helger edited this page Apr 8, 2026 · 1 revision

Generic type conversion framework. Converters are registered via SPI and looked up at runtime.

Highlights:

  • TypeConverter - main entry point for converting between Java types
  • ITypeConverter<SRC,DST> - converter interface (extends Function)
  • TypeConverterRegistry - central converter registry (populated via SPI)
  • ITypeConverterRule - rule-based converters for non-exact class matches
  • ClassHierarchyCache - class hierarchy walking for fuzzy converter lookup

Also contains typed attribute containers:

  • IStringMap / StringMap - String-keyed, String-valued map
  • IAttributeContainerAny / AttributeContainerAny - type-safe attribute storage with automatic conversion

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.commons</groupId>
  <artifactId>ph-typeconvert</artifactId>
  <version>x.y.z</version>
</dependency>

Clone this wiki locally