com.tngtech.jgiven.annotation.NamedFormat Maven / Gradle / Ivy
package com.tngtech.jgiven.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.tngtech.jgiven.format.DefaultObjectFormatter;
/**
*
* Allow to specify an identifiable format
*
*
* @See also {@link NamedFormats}
* @since 0.15.0
*/
@Retention( RetentionPolicy.RUNTIME )
@Target( { ElementType.PARAMETER, ElementType.ANNOTATION_TYPE } )
public @interface NamedFormat {
/**
* Specify a name identifying this format
*/
String name();
/**
* Specify an inline {@link Format}
*
*
* Mutually exclusive with {@link #formatAnnotation()}
*
*/
Format format() default @Format( DefaultObjectFormatter.class );
/**
* Specify a custom format annotation
*
*
*
* - mutually exclusive with {@link #format()}
* - when set, has precedence over any specified {@link #format()}
*
*
*
* @See JGiven User Guide - Custom formatting annotations
*/
Class extends Annotation> formatAnnotation() default Annotation.class;
}