Skip to content

0.8.0

Choose a tag to compare

@jwcarman jwcarman released this 20 Apr 03:48
· 10 commits to main since this release

Breaking changes

  • MethodInvokerFactory interface and DefaultMethodInvokerFactory class removed. Replaced by a nested public interface MethodInvoker.Builder<A> with .resolver(...) / .interceptor(...) / .build(). The concrete implementation (DefaultMethodInvokerBuilder) is package-private; users obtain builders via MethodInvoker.builder(method, target, argumentType). The old factory interface + implementation provided no value over a direct builder for a stateless, single-implementation construction operation.
  • MethodInvokerConfig<A> interface removed. The separate "config surface without build()" interface is absorbed into MethodInvoker.Builder<A>. Helpers that want to accept configuration contributions take Consumer<MethodInvoker.Builder<A>> or the builder itself; convention ("don't call build() from inside the contributor") replaces the type-system signal.
  • Package flattened. The org.jwcarman.methodical.def, org.jwcarman.methodical.intercept, and org.jwcarman.methodical.param subpackages are gone. All public and package-private types now live in a single org.jwcarman.methodical package. Imports like org.jwcarman.methodical.intercept.MethodInterceptor become org.jwcarman.methodical.MethodInterceptor; likewise for ParameterInfo, ParameterResolver, MethodInvocation, MethodInterceptors.
  • methodical-autoconfigure and methodical-spring-boot-starter modules removed. Methodical now ships as a plain Java library with no Spring Boot coupling. The Maven coordinates org.jwcarman.methodical:methodical-autoconfigure and org.jwcarman.methodical:methodical-spring-boot-starter no longer exist. The BOM (methodical-bom) no longer declares those artifacts. Spring Boot consumers now wire beans themselves — see migration below.

Migration

Construction (before):

MethodInvokerFactory factory = new DefaultMethodInvokerFactory();
MethodInvoker<Req> invoker = factory.create(
    method, target, Req.class,
    cfg -> cfg.resolver(r).interceptor(i));

Construction (after):

MethodInvoker<Req> invoker =
    MethodInvoker.builder(method, target, Req.class)
        .resolver(r)
        .interceptor(i)
        .build();

Spring Boot consumers (before — Spring Boot starter):

<dependency>
  <groupId>org.jwcarman.methodical</groupId>
  <artifactId>methodical-spring-boot-starter</artifactId>
  <version>0.7.0</version>
</dependency>

Spring Boot consumers (after — plain libraries + one @Configuration class you write yourself):

<dependency>
  <groupId>org.jwcarman.methodical</groupId>
  <artifactId>methodical-core</artifactId>
  <version>0.8.0</version>
</dependency>
<dependency>
  <groupId>org.jwcarman.methodical</groupId>
  <artifactId>methodical-jackson3</artifactId>
  <version>0.8.0</version>
</dependency>
<!-- optional -->
<dependency>
  <groupId>org.jwcarman.methodical</groupId>
  <artifactId>methodical-jakarta-validation</artifactId>
  <version>0.8.0</version>
</dependency>
@Configuration
class MethodicalConfig {
  @Bean Jackson3ParameterResolver jsonResolver(ObjectMapper mapper) {
    return new Jackson3ParameterResolver(mapper);
  }

  @Bean @ConditionalOnBean(Validator.class)
  JakartaValidationInterceptor jakartaValidation(Validator validator) {
    return new JakartaValidationInterceptor(validator);
  }
}

// In the class that builds invokers, inject the beans above and call
//   MethodInvoker.builder(method, target, argType)
//       .resolver(jsonResolver)
//       .interceptor(jakartaValidation)
//       .build();