Skip to content

docs: update specifications#7

Merged
mlopezFC merged 1 commit into
masterfrom
update-specs-20260429
Apr 29, 2026
Merged

docs: update specifications#7
mlopezFC merged 1 commit into
masterfrom
update-specs-20260429

Conversation

@javier-godoy
Copy link
Copy Markdown
Member

Summary

  • Section 3.3: removed the four unimplemented convenience methods (setDateFormat, setDateTimeFormat, setNumberFormat, setBooleanLabels); added setNullRepresentation, setRendererFactory, and as(Class<S>) to match the actual API.
  • Section 3.3 usage example: replaced setDateFormat/setBooleanLabels calls with as(…).setFormatter(…) and as(…).setRendererFactory(LocalDateRenderers.of(…)).
  • Section 7 complete example: same substitution.

Rationale for spec changes

An earlier design of EasyColumn included type-specific convenience setters: setDateFormat, setDateTimeFormat, setNumberFormat, and setBooleanLabels. These were removed from the spec as a design decision. The problem is that these methods cannot be made type-safe without first narrowing V. Placed on EasyColumn<T, V> for all V, they allow:

  easyGrid.getColumn("active")      // EasyColumn<Person, Boolean>
      .setDateFormat("dd/MM/yyyy"); // compiles — silently wrong at render time

setRendererFactory(RendererFactory<T, V>) avoids this entirely. LocalDateRenderers.of("dd/MM/yyyy") produces a RendererFactory<T, LocalDate>, so assigning it to an EasyColumn<T, Boolean> is a compile error. The as(Class<S>) method narrows V explicitly before the call, making the type constraint visible at the call site:

  easyGrid.getColumn("birthDate")            // EasyColumn<T,?>
      .as(LocalDate.class)                              // V narrowed to LocalDate
      .setRendererFactory(LocalDateRenderers.of("dd/MM/yyyy")); // type-checked

The renderer utility classes (LocalDateRenderers, LocalDateTimeRenderers, NumberRenderers) provide the same named, discoverable entry points that the convenience setters would have offered.

Copy link
Copy Markdown
Member

@mlopezFC mlopezFC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mlopezFC mlopezFC merged commit 9ad359a into master Apr 29, 2026
3 checks passed
@mlopezFC mlopezFC deleted the update-specs-20260429 branch April 29, 2026 18:58
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

2 participants