Repository navigation
0.1.0
Codec 0.1.0
Initial release of Codec — a type-safe serialization abstraction for Java.
Highlights
- Core SPI —
Codec<T>,CodecFactory, andTypeRef<T>super type token with properequals()/hashCode()for use as cache keys - Jackson backend — JSON serialization via
ObjectMapper, supports generic types throughTypeRef - Gson backend — JSON serialization via
Gson, supports generic types throughTypeRef - Protocol Buffers backend — Binary serialization using idiomatic
Parser<T>API (Protobuf 4.x) - Spring Boot auto-configuration — Drop a backend on the classpath and get a
CodecFactorybean automatically - BOM module —
codec-bomfor dependency version alignment
Requirements
- Java 25+
- Spring Boot 4.x
Getting Started
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jwcarman.codec</groupId>
<artifactId>codec-bom</artifactId>
<version>0.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>org.jwcarman.codec</groupId>
<artifactId>codec-jackson</artifactId>
</dependency>@Service
public class MyService {
private final Codec<Person> codec;
public MyService(CodecFactory factory) {
this.codec = factory.create(Person.class);
}
}See the README for full documentation.