Skip to content

0.1.0

Choose a tag to compare

@jwcarman jwcarman released this 07 Apr 13:08
· 231 commits to main since this release

Codec 0.1.0

Initial release of Codec — a type-safe serialization abstraction for Java.

Highlights

  • Core SPI — Codec<T>, CodecFactory, and TypeRef<T> super type token with proper equals()/hashCode() for use as cache keys
  • Jackson backend — JSON serialization via ObjectMapper, supports generic types through TypeRef
  • Gson backend — JSON serialization via Gson, supports generic types through TypeRef
  • 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 CodecFactory bean automatically
  • BOM module — codec-bom for 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.