Double/float range annotation

Open
#122 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java

Research direction

Start by locating the existing @Range annotation and related annotation definitions in the project. Compare their retention and target behavior with the proposed DoubleRange API, then determine how floating-point bounds should be represented and documented. Done means the project has a reviewed double/float range annotation with clear inclusive-bound semantics.

Written by the indexing model from the issue text.

Description

It would be incredibly useful to have something similar to @Range for doubles/floats.

For example, to indicate that the return value is always in the range [0, 1] (0 to 1, inclusive)

something like

@Documented
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.TYPE_USE})
public @interface DoubleRange {
  double from();
  double to();
}
Dominant language
Kotlin
Stars
464
Forks
73
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JetBrains/java-annotations

All issues in JetBrains/java-annotations

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.