Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-834

Validate: add inclusiveBetween and exclusiveBetween overloads for primitives types

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.3
    • lang.*
    • None

    Description

      Validate.inclusiveBetween() is often going to be used with primitives, so it might make sense to add

      inclusiveBetween(long start, long end, long value)
      and
      inclusiveBetween(long start, long end, long value, String message)

      This would avoid the overhead of using boxing and compareTo() for the primitive number types.

      Note: I tried adding

      inclusiveBetween(long start, long end, long value, String message, Object ... values)

      but that causes the compiler to complain about ambiguous methods.
      However, that's unlikely to be needed much.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            britter Benedikt Ritter
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment