Class LongArrayConverter

java.lang.Object
com.atlassian.jira.webwork.parameters.LongArrayConverter
All Implemented Interfaces:
ParameterConverter

public class LongArrayConverter extends Object
A implementation of ParameterConverter for Long objects

Introduced / changed as part of JRA-15664

Since:
v3.13.2
  • Constructor Details

    • LongArrayConverter

      public LongArrayConverter()
  • Method Details

    • convertParameter

      public Object convertParameter(String[] parameterValues, Class paramType) throws IllegalArgumentException
      Description copied from interface: ParameterConverter
      This is called to perform the conversion. The parameterValues will always be a String[] of length 1 or more. It can never be null.
      Parameters:
      parameterValues - a String[] that is never null and at least length 1 or more.
      paramType - the type of the target object
      Returns:
      a converted object of the right type
      Throws:
      IllegalArgumentException - if the value cant be converted
    • isEmpty

      protected boolean isEmpty(String parameterValue)
      The same test that webwork1 uses for null-able Longs/Integers/Shorts/Bytes
      Parameters:
      parameterValue - the parameter value
      Returns:
      true if its an empty string
    • checkPrimitiveInput

      protected void checkPrimitiveInput(String parameterValue, Class paramType, String bundleKey)
      Throws a PropertyEditorException just like webwork1 when a value is a primitive AND the string is empty
      Parameters:
      parameterValue - the value in play
      paramType - the type of parameter
      bundleKey - the webwork1 bundle key to use