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

Validate: add inclusiveBetween and exclusiveBetween overloads for primitives types

    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

        1. LANG-834.patch
          4 kB
          Sebb

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: