Package org.easymock

Class ConstructorArgs


  • public class ConstructorArgs
    extends java.lang.Object
    Class wrapping arguments to create a partial class mock that gets instantiated by calling one of its constructors.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.reflect.Constructor<?> constructor  
      private java.lang.Object[] initArgs  
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstructorArgs​(java.lang.reflect.Constructor<?> constructor, java.lang.Object... initArgs)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.reflect.Constructor<?> getConstructor()  
      java.lang.Object[] getInitArgs()  
      private java.lang.IllegalArgumentException throwException​(java.lang.Class<?> paramType, java.lang.Object arg)  
      private void validateArgs()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • constructor

        private final java.lang.reflect.Constructor<?> constructor
      • initArgs

        private final java.lang.Object[] initArgs
    • Constructor Detail

      • ConstructorArgs

        public ConstructorArgs​(java.lang.reflect.Constructor<?> constructor,
                               java.lang.Object... initArgs)
        Parameters:
        constructor - Constructor to be called when creating the mock
        initArgs - Arguments passed to the constructor
    • Method Detail

      • validateArgs

        private void validateArgs()
      • throwException

        private java.lang.IllegalArgumentException throwException​(java.lang.Class<?> paramType,
                                                                  java.lang.Object arg)
      • getInitArgs

        public java.lang.Object[] getInitArgs()
        Returns:
        arguments to be passed to the constructor
      • getConstructor

        public java.lang.reflect.Constructor<?> getConstructor()
        Returns:
        constructor to be called