$ show krud-dev/shapeshift
ShapeShift is a Kotlin/Java library for intelligent object mapping and conversion between objects. It provides multiple ways to define mappings including annotations, a Kotlin DSL, and a Java Builder API. The library features automatic mapping, custom type transformers, conditional mapping, decorators for post-processing, and seamless Spring Framework integration. Its architecture cleanly separates mapping definition resolution from the core mapping engine, making it extensible and flexible.
The LLM identified 3 files worth highlighting for reuse:
Contains reusable reflection utilities for working with classes and fields, including getDeclaredFieldRecursive (finds fields in class hierarchy), getDeclaredFieldsRecursive (gets all fields including superclass fields), and getGenericAtPosition (safely extracts type arguments from parameterized fields). These solve common reflection problems with minimal dependencies (only java.lang.reflect) and demonstrate non-obvious skill in handling Java inheritance complexities.
Contains a splitIgnoreEmpty function that splits a string and filters out empty results. This is a self-contained, zero-dependency utility that solves a ubiquitous string processing need. While simple, it represents a useful pattern for avoiding repetitive code and can be copied directly to any project with no modification.
A simple data class representing a field on an object (holding the target object, field reference, and field type). Only depends on java.lang.reflect.Field and is used in the codebase as part of a general pattern for reflective field access. This encapsulation of reflection-related information is reusable in any scenario requiring field manipulation via reflection, demonstrating how to create generic abstractions over core Java reflection APIs.