Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Support Duration and Optional #54

Open
astubbs opened this issue Aug 12, 2020 · 2 comments
Open

Support Duration and Optional #54

astubbs opened this issue Aug 12, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@astubbs
Copy link

astubbs commented Aug 12, 2020

Just trying out your project - interesting idea. I immediately hit the missing Duration#toSeconds et al and Optional#isEmpty...

Do you have any policy on the scope of the project?

toSeconds was intro'd in 9
isEmpty was 11

@tlinkowski
Copy link
Owner

Hi Antony, thanks!

The main policy is expressed in the notes:

UniJ may only introduce new APIs that directly correspond to APIs in the latest stable release of the JDK

So it's not completely out of question, but I took an approach of providing static facade methods for JDK instance methods only if:

  1. they are non-trivial (unlike e.g. Optional.isEmpty or Duration.toSeconds),
  2. and using static methods instead of instance methods wouldn't be cumbersome (unlike in case of e.g. Stream.takeWhile)

I wouldn't like to clutter the library with features that few people might need (UniJ is already way to complex), especially if they're so easy to introduce on one's own (as you did). But if there were several requests for any method like that, I'd reconsider (I'll leave this issue open for that purpose).

PS. As to Duration.toSeconds - are you aware of its pre-JDK9 alias, Duration.getSeconds?

@tlinkowski tlinkowski added the enhancement New feature or request label Aug 14, 2020
@astubbs
Copy link
Author

astubbs commented Aug 14, 2020

Thanks for the thoughtful response!
No I wasn’t - thanks :)

astubbs added a commit to confluentinc/parallel-consumer that referenced this issue Oct 9, 2020
Run test on jdk9
As the automatic detection method is turned off when any processor is configured explicitly, Lombok has to be set explicitly
UniJ - UniLists.of etc…
Remove redundant GroupIDs - they are inherited
UniJ doesn’t support Optional or Duration
tlinkowski/UniJ#54
AtomicBoolean java 8 support
Duration.convert duration intro’d in 11
Broken on java 8 - class file version too high in UniJ
JVM locations 8 vs 9
astubbs added a commit to confluentinc/parallel-consumer that referenced this issue Oct 13, 2020
Run test on jdk9
As the automatic detection method is turned off when any processor is configured explicitly, Lombok has to be set explicitly
UniJ - UniLists.of etc…
Remove redundant GroupIDs - they are inherited
UniJ doesn’t support Optional or Duration
tlinkowski/UniJ#54
AtomicBoolean java 8 support
Duration.convert duration intro’d in 11
Broken on java 8 - class file version too high in UniJ
JVM locations 8 vs 9
astubbs added a commit to confluentinc/parallel-consumer that referenced this issue Oct 13, 2020
Run test on jdk9
As the automatic detection method is turned off when any processor is configured explicitly, Lombok has to be set explicitly
UniJ - UniLists.of etc…
Remove redundant GroupIDs - they are inherited
UniJ doesn’t support Optional or Duration
tlinkowski/UniJ#54
AtomicBoolean java 8 support
Duration.convert duration intro’d in 11
Broken on java 8 - class file version too high in UniJ
JVM locations 8 vs 9
astubbs added a commit to confluentinc/parallel-consumer that referenced this issue Oct 19, 2020
Run test on jdk9
As the automatic detection method is turned off when any processor is configured explicitly, Lombok has to be set explicitly
UniJ - UniLists.of etc…
Remove redundant GroupIDs - they are inherited
UniJ doesn’t support Optional or Duration
tlinkowski/UniJ#54
AtomicBoolean java 8 support
Duration.convert duration intro’d in 11
Broken on java 8 - class file version too high in UniJ
JVM locations 8 vs 9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants