public final class Foo { @NotNull private final String id; @NotNull private final String name; @Nullable private final Integer count; @NotNull public final String getId() { return this.id; } @NotNull public final String getName() { return this.name; } @Nullable public final Integer getCount() { return this.count; } public Foo(@NotNull String id, @NotNull String name, @Nullable Integer count) { Intrinsics.checkParameterIsNotNull(id, "id"); Intrinsics.checkParameterIsNotNull(name, "name"); super(); this.id = id; this.name = name; this.count = count; } }