Class AbstractArrayNodeConversion<T>

java.lang.Object
org.tudalgo.algoutils.tutor.general.conversion.AbstractArrayNodeConversion<T>
All Implemented Interfaces:
org.junit.jupiter.params.converter.ArgumentConverter
Direct Known Subclasses:
ArrayConverter.BigDecimal, ArrayConverter.BigDecimal2D, ArrayConverter.BigInteger, ArrayConverter.BigInteger2D, ArrayConverter.Boolean, ArrayConverter.Boolean2D, ArrayConverter.Double, ArrayConverter.Double2D, ArrayConverter.Float, ArrayConverter.Float2D, ArrayConverter.Integer, ArrayConverter.Integer2D, ArrayConverter.Long, ArrayConverter.Long2D, ArrayConverter.Number, ArrayConverter.Number2D, ArrayConverter.Short, ArrayConverter.Short2D, ArrayConverter.String, ArrayConverter.String2D

public abstract class AbstractArrayNodeConversion<T> extends Object implements org.junit.jupiter.params.converter.ArgumentConverter
  • Field Details

    • baseConverter

      @Nullable protected final AbstractArrayNodeConversion<?> baseConverter
      Base conversion (n-1)d array to n-d array. The base conversion is null for n=1.
  • Constructor Details

    • AbstractArrayNodeConversion

      public AbstractArrayNodeConversion()
    • AbstractArrayNodeConversion

      public AbstractArrayNodeConversion(@Nullable AbstractArrayNodeConversion<?> baseConverter)
  • Method Details

    • convert

      public Object convert(Object source, org.junit.jupiter.api.extension.ParameterContext context) throws org.junit.jupiter.params.converter.ArgumentConversionException
      Specified by:
      convert in interface org.junit.jupiter.params.converter.ArgumentConverter
      Throws:
      org.junit.jupiter.params.converter.ArgumentConversionException
    • getBaseConverter

      @Nullable public AbstractArrayNodeConversion<?> getBaseConverter()
    • convert

      public abstract T[] convert(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, org.junit.jupiter.api.extension.ParameterContext context) throws org.junit.jupiter.params.converter.ArgumentConversionException
      Converts a JSON array into another type.
      Parameters:
      arrayNode - the JSON array node to be converted
      context - context in which the parameter is converted
      Returns:
      a converted object
      Throws:
      org.junit.jupiter.params.converter.ArgumentConversionException - if the conversion fails