Skip to content

@With

Generates with{Field}(value) methods that return a new instance with one field changed.

KindCodegen
Backendslegacy, stage3
Requires generateYes

Class or field level

ts
import { With } from 'lombok-typescript/legacy';

@With
class Point {
  x!: number;
  y!: number;
}

// Or per-field:
class Label {
  @With
  text!: string;
}

@Value includes @With for every field automatically.

Released under the MIT License.