Package com.tngtech.jgiven.annotation
Annotation Interface POJOFormat
@Documented
@AnnotationFormat(POJOAnnotationFormatter.class)
@Retention(RUNTIME)
@Target({PARAMETER,ANNOTATION_TYPE})
public @interface POJOFormat
A special format annotation to format POJOs
- Since:
- 0.15.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration of opening/closing brackets pair :POJOFormat.BracketsEnum.NONE
: no bracketsPOJOFormat.BracketsEnum.PARENTHESES
:(...)
POJOFormat.BracketsEnum.SQUARE
:[...]
POJOFormat.BracketsEnum.BRACES
:{...}
POJOFormat.BracketsEnum.POINTY
:<...>
POJOFormat.BracketsEnum.CHEVRONS
:<<...>>
POJOFormat.BracketsEnum.DOUBLE_QUOTE
:"..."
POJOFormat.BracketsEnum.SINGLE_QUOTE
:'...'
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionSpecify the opening/closing brackets pair to set POJO string representation apart of its parent (step) string representation.String[]
Specifies which fields should be excluded in the report.Specify an array ofNamedFormat
to use when formatting POJOs fields.Class<? extends Annotation>
Specify a customNamedFormats
annotationSpecify a field separatorString[]
Specifies which fields should be included in the report.boolean
Whether or not columns with onlynull
values are shown or not.boolean
When set totrue
, each formatted field value is prefixed by its field name
-
Element Details
-
excludeFields
String[] excludeFieldsSpecifies which fields should be excluded in the report.If
includeFields()
is set, then this attribute has no effect- Default:
- {}
-
includeFields
String[] includeFieldsSpecifies which fields should be included in the report. All fields not in this list will be excluded.- Default:
- {}
-
includeNullColumns
boolean includeNullColumnsWhether or not columns with onlynull
values are shown or not. Default is to not show them.- Default:
- false
-
prefixWithFieldName
boolean prefixWithFieldNameWhen set totrue
, each formatted field value is prefixed by its field name- Default:
- false
-
fieldSeparator
String fieldSeparatorSpecify a field separator- Default:
- ","
-
brackets
POJOFormat.BracketsEnum bracketsSpecify the opening/closing brackets pair to set POJO string representation apart of its parent (step) string representation.Default brackets pair is
POJOFormat.BracketsEnum.SQUARE
.
When no brackets is needed, consider specifyPOJOFormat.BracketsEnum.NONE
- Default:
- SQUARE
-
fieldFormatsAnnotation
Class<? extends Annotation> fieldFormatsAnnotationSpecify a customNamedFormats
annotationThe
NamedFormat
defined in this set will be used when formatting POJOs fields.
- Default:
- java.lang.annotation.Annotation.class
-
fieldFormats
NamedFormat[] fieldFormatsSpecify an array ofNamedFormat
to use when formatting POJOs fields.When a
NamedFormat.name()
matches a field name, field value is formatted using thisNamedFormat
.Note: when set, has precedence over
fieldFormatsAnnotation()
- Default:
- {}
-