Class ArrayModel

  • All Implemented Interfaces:
    Model

    public class ArrayModel
    extends java.lang.Object
    implements Model
    A Model to track array values.
    • Constructor Detail

      • ArrayModel

        public ArrayModel​(Value[] values,
                          java.lang.String type)
    • Method Detail

      • getValues

        public Value[] getValues()
      • getType

        @NotNull
        public @NotNull java.lang.String getType()
        Description copied from interface: Model
        Returns the type of the modeled class.
        Specified by:
        getType in interface Model
      • init

        public MethodResult init​(MethodExecutionInfo methodExecutionInfo,
                                 ValueCalculator valueCalculator)
        Description copied from interface: Model
        Execute a constructor call for the modeled class.

        It is suggested to add logic to allow running this only on a dummy model without any state.

        Specified by:
        init in interface Model
        Parameters:
        methodExecutionInfo - execution info of the target method.
        valueCalculator - the value calculator that should be used to create any value in the result.
        Returns:
        the result of the method invocation. Since it's a constructor invocation the return value of the result is expected to be empty and the constructed value should be set as the updated instance.
      • invoke

        public MethodResult invoke​(MethodExecutionInfo methodExecutionInfo,
                                   ValueCalculator valueCalculator)
        Description copied from interface: Model
        Execute an instance method on the modeled object. The state of the instance is represented by the state of the model.

        It is suggested to add logic to allow running this only on a model representing an initialized object.

        Specified by:
        invoke in interface Model
        Parameters:
        methodExecutionInfo - execution info of the target method.
        valueCalculator - the value calculator that should be used to create any value in the result.
        Returns:
        the result of the method invocation.
      • invokeStatic

        public MethodResult invokeStatic​(MethodExecutionInfo methodExecutionInfo,
                                         ValueCalculator valueCalculator)
        Description copied from interface: Model
        Execute a static method for the modeled class.

        It is suggested to add logic to allow running this only on a dummy model without any state.

        Specified by:
        invokeStatic in interface Model
        Parameters:
        methodExecutionInfo - execution info of the target method.
        valueCalculator - the value calculator that should be used to create any value in the result.
        Returns:
        the result of the method invocation.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object