Interface ArgsProblems

All Superinterfaces:
ProblemFactory

public interface ArgsProblems extends ProblemFactory

Factory for producing problems that involve arguments - either to a function or a pipeline step.

  • Method Details

    • notNumeric

      Problem notNumeric(FunctionArgument argument, Type actual)
    • wrongNumber

      Problem wrongNumber(int expected, int actual)
    • wrongNumber

      Problem wrongNumber(com.google.common.collect.Range<Integer> expected, int actual)
    • wrongNumberRange

      Problem wrongNumberRange(int min, int max, int actual)

      When a variable number of arguments is allowed, but the number supplied is outside of that range.

      Parameters:
      min - lest number of arguments required
      max - greatest number of arguments allowed
      actual - the number of arguments supplied
    • realizableDidNotMatch

      Problem realizableDidNotMatch(IdentifiedFunction target, List<Type> givenTypes)
    • realizableDidNotMatch

      Problem realizableDidNotMatch(Class<?> target, List<Type> givenTypes)
    • mismatch

      static Problem mismatch(FunctionArgument argument, Type actual)

      Convenient way to generate a Problem when there's a type mismatch for one of the supplied arguments.

    • mismatch

      static Problem mismatch(FunctionArgument argument, Type expected, Type actual)

      Similar to mismatch(FunctionArgument argument, Type actual) but the expected argument type is provided.

      This is useful in cases where the argument accepts Types.ANYTHNING but a specific type is required, e.g a struct of any kind. Using this problem means we don't get a weird error of expected anything but was given list.

    • mismatch

      static Problem mismatch(FunctionArgument argument, Type actual, List<Type> allowedTypes)

      Convenient way to generate a Problem when there's a type mismatch for one of the supplied arguments. Used when the function allows the argument to be one of the allowedTypes but actual is not one of them.

    • get

      static ArgsProblems get()
    • required

      Problem required(String keyword)

      A required keyword argument is not present

      NB this is currently only likely to happen for aggregate functions, as they realize differently. However once we address GL#114 we might support named arguments in plain function calls as well without the existing ordering restriction, and so this might be a nicer/better error message than the arity error we have

    • constantNull

      Problem constantNull()

      When an argument has been evaluated as a constant and it contains a null value.

      See FunctionCall.Argument#evaluateConstant(RealizationContext, Class<T>, Type) for how to use this problem and why it exists.