Class DefaultArgumentsAccessor

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Object get​(int index)
      Get the value of the argument at the given index as an Object.
      <T> T get​(int index, Class<T> requiredType)
      Get the value of the argument at the given index as an instance of the required type.
      Boolean getBoolean​(int index)
      Get the value of the argument at the given index as a Boolean, performing automatic type conversion as necessary.
      Byte getByte​(int index)
      Get the value of the argument at the given index as a Byte, performing automatic type conversion as necessary.
      Character getCharacter​(int index)
      Get the value of the argument at the given index as a Character, performing automatic type conversion as necessary.
      Double getDouble​(int index)
      Get the value of the argument at the given index as a Double, performing automatic type conversion as necessary.
      Float getFloat​(int index)
      Get the value of the argument at the given index as a Float, performing automatic type conversion as necessary.
      Integer getInteger​(int index)
      Get the value of the argument at the given index as a Integer, performing automatic type conversion as necessary.
      Long getLong​(int index)
      Get the value of the argument at the given index as a Long, performing automatic type conversion as necessary.
      Short getShort​(int index)
      Get the value of the argument at the given index as a Short, performing automatic type conversion as necessary.
      String getString​(int index)
      Get the value of the argument at the given index as a String, performing automatic type conversion as necessary.
      int size()
      Get the number of arguments in this accessor.
      Object[] toArray()
      Get all arguments in this accessor as an array.
      List<Object> toList()
      Get all arguments in this accessor as an immutable list.
    • Constructor Detail

      • DefaultArgumentsAccessor

        public DefaultArgumentsAccessor​(Object... arguments)
    • Method Detail

      • get

        public Object get​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as an Object.
        Specified by:
        get in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null
      • get

        public <T> T get​(int index,
                         Class<T> requiredType)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as an instance of the required type.
        Specified by:
        get in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        requiredType - the required type of the value; never null
        Returns:
        the value at the given index, potentially null
      • getCharacter

        public Character getCharacter​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as a Character, performing automatic type conversion as necessary.
        Specified by:
        getCharacter in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null
      • getBoolean

        public Boolean getBoolean​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as a Boolean, performing automatic type conversion as necessary.
        Specified by:
        getBoolean in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null
      • getByte

        public Byte getByte​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as a Byte, performing automatic type conversion as necessary.
        Specified by:
        getByte in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null
      • getShort

        public Short getShort​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as a Short, performing automatic type conversion as necessary.
        Specified by:
        getShort in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null
      • getInteger

        public Integer getInteger​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as a Integer, performing automatic type conversion as necessary.
        Specified by:
        getInteger in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null
      • getLong

        public Long getLong​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as a Long, performing automatic type conversion as necessary.
        Specified by:
        getLong in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null
      • getFloat

        public Float getFloat​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as a Float, performing automatic type conversion as necessary.
        Specified by:
        getFloat in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null
      • getDouble

        public Double getDouble​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as a Double, performing automatic type conversion as necessary.
        Specified by:
        getDouble in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null
      • getString

        public String getString​(int index)
        Description copied from interface: ArgumentsAccessor
        Get the value of the argument at the given index as a String, performing automatic type conversion as necessary.
        Specified by:
        getString in interface ArgumentsAccessor
        Parameters:
        index - the index of the argument to get; must be greater than or equal to zero and less than ArgumentsAccessor.size()
        Returns:
        the value at the given index, potentially null