junitparams.converters
Interface Converter<A extends Annotation,T>

Type Parameters:
A - type of annotation mentioning this converter
T - conversion target type
All Known Implementing Classes:
NullableConverter

public interface Converter<A extends Annotation,T>

Defines the logic to convert parameter annotated with A to type T. Converter must have a public no-args constructor. Configuration is done via initialize(java.lang.annotation.Annotation) method
Inspired by javax.validation.ConstraintValidator


Method Summary
 T convert(Object param)
          Converts param to desired type.
 void initialize(A annotation)
          Initializes this converter - you can read your annotation config here.
 

Method Detail

initialize

void initialize(A annotation)
Initializes this converter - you can read your annotation config here.


convert

T convert(Object param)
          throws ConversionFailedException
Converts param to desired type.

Throws:
ConversionFailedException


Copyright © 2017 Pragmatists. All rights reserved.