public class Configuration
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.text.DateFormat> |
additionalDateFormats |
static boolean |
ALLOW_COMPARING_PRIVATE_FIELDS |
static boolean |
ALLOW_EXTRACTING_PRIVATE_FIELDS |
static boolean |
BARE_NAME_PROPERTY_EXTRACTION_ENABLED |
private boolean |
bareNamePropertyExtraction |
private boolean |
comparingPrivateFields |
static Configuration |
DEFAULT_CONFIGURATION |
private boolean |
extractingPrivateFields |
static boolean |
LENIENT_DATE_PARSING |
private boolean |
lenientDateParsing |
static int |
MAX_ELEMENTS_FOR_PRINTING |
static int |
MAX_LENGTH_FOR_SINGLE_LINE_DESCRIPTION |
private int |
maxElementsForPrinting |
private int |
maxLengthForSingleLineDescription |
static boolean |
REMOVE_ASSERTJ_RELATED_ELEMENTS_FROM_STACK_TRACE |
private boolean |
removeAssertJRelatedElementsFromStackTrace |
Constructor and Description |
---|
Configuration() |
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalDateFormats(java.text.DateFormat... additionalDateFormats)
Add the given date formats AssertJ will use in date assertions.
|
java.util.List<java.text.DateFormat> |
additionalDateFormats()
AssertJ uses defaults date formats in date assertions, this property let's you register additional ones (default there are no addtional date formats).
|
void |
apply()
Applies this configuration to AssertJ.
|
void |
applyAndDisplay()
Applies this configuration to AssertJ and prints it.
|
boolean |
bareNamePropertyExtractionEnabled()
Returns whether the extractor considers bare-named property methods like
String name() . |
boolean |
comparingPrivateFieldsEnabled()
Returns whether private fields comparison is enabled.
|
java.lang.String |
describe() |
private java.lang.String |
describe(java.text.DateFormat dateFormat) |
private java.lang.String |
describeAdditionalDateFormats() |
boolean |
extractingPrivateFieldsEnabled()
Returns whether private fields comparison is enabled.
|
(package private) boolean |
hasCustomRepresentation() |
boolean |
lenientDateParsingEnabled()
Returns whether AssertJ will use lenient parsing mode for default date formats.
|
int |
maxElementsForPrinting()
Returns the maximum length for an iterable/array to be displayed on one line.
|
int |
maxLengthForSingleLineDescription()
Returns the maximum length for an iterable/array to be displayed on one line.
|
boolean |
removeAssertJRelatedElementsFromStackTraceEnabled()
Returns whether AssertJ related elements are removed from assertion errors stack trace.
|
Representation |
representation() |
void |
setAdditionalDateFormats(java.util.List<java.text.DateFormat> additionalDateFormats)
Returns the additional date formats AssertJ will use in date assertions.
|
void |
setBareNamePropertyExtraction(boolean bareNamePropertyExtraction)
Sest whether the extractor considers bare-named property methods like
String name() . |
void |
setComparingPrivateFields(boolean comparingPrivateFields)
Sets whether private fields comparison is enabled.
|
void |
setExtractingPrivateFields(boolean extractingPrivateFields)
Sets whether private fields comparison is enabled.
|
void |
setLenientDateParsing(boolean lenientDateParsing)
Returns whether AssertJ will use lenient parsing mode for default date formats.
|
void |
setMaxElementsForPrinting(int maxElementsForPrinting)
Returns the maximum length for an iterable/array to be displayed on one line.
|
void |
setMaxLengthForSingleLineDescription(int maxLengthForSingleLineDescription)
Sets the maximum length for an iterable/array to be displayed on one line.
|
void |
setRemoveAssertJRelatedElementsFromStackTrace(boolean removeAssertJRelatedElementsFromStackTrace)
Returns whether AssertJ related elements are removed from assertion errors stack trace.
|
public static final Configuration DEFAULT_CONFIGURATION
public static final int MAX_LENGTH_FOR_SINGLE_LINE_DESCRIPTION
public static final int MAX_ELEMENTS_FOR_PRINTING
public static final boolean REMOVE_ASSERTJ_RELATED_ELEMENTS_FROM_STACK_TRACE
public static final boolean ALLOW_COMPARING_PRIVATE_FIELDS
public static final boolean ALLOW_EXTRACTING_PRIVATE_FIELDS
public static final boolean BARE_NAME_PROPERTY_EXTRACTION_ENABLED
public static final boolean LENIENT_DATE_PARSING
private boolean comparingPrivateFields
private boolean extractingPrivateFields
private boolean bareNamePropertyExtraction
private boolean removeAssertJRelatedElementsFromStackTrace
private boolean lenientDateParsing
private java.util.List<java.text.DateFormat> additionalDateFormats
private int maxLengthForSingleLineDescription
private int maxElementsForPrinting
public Representation representation()
Representation
that is used within AssertJ.boolean hasCustomRepresentation()
public boolean comparingPrivateFieldsEnabled()
See Assertions.setAllowComparingPrivateFields(boolean)
for a detailed description.
public void setComparingPrivateFields(boolean comparingPrivateFields)
See Assertions.setAllowComparingPrivateFields(boolean)
for a detailed description.
Note that this change will only be effective once apply()
or applyAndDisplay()
is called.
comparingPrivateFields
- whether private fields comparison is enabled.public boolean extractingPrivateFieldsEnabled()
See Assertions.setAllowExtractingPrivateFields(boolean)
for a detailed description.
public void setExtractingPrivateFields(boolean extractingPrivateFields)
See Assertions.setAllowExtractingPrivateFields(boolean)
for a detailed description.
Note that this change will only be effective once apply()
or applyAndDisplay()
is called.
extractingPrivateFields
- whether private fields comparison is enabled.public boolean bareNamePropertyExtractionEnabled()
String name()
.
Default is true.
See Assertions.setExtractBareNamePropertyMethods(boolean)
for a detailed description.
String name()
.public void setBareNamePropertyExtraction(boolean bareNamePropertyExtraction)
String name()
.
See Assertions.setExtractBareNamePropertyMethods(boolean)
for a detailed description.
Note that this change will only be effective once apply()
or applyAndDisplay()
is called.
bareNamePropertyExtraction
- whether the extractor considers bare-named property methods.public boolean removeAssertJRelatedElementsFromStackTraceEnabled()
See Assertions.setRemoveAssertJRelatedElementsFromStackTrace(boolean)
for a detailed description.
public void setRemoveAssertJRelatedElementsFromStackTrace(boolean removeAssertJRelatedElementsFromStackTrace)
See Assertions.setRemoveAssertJRelatedElementsFromStackTrace(boolean)
for a detailed description.
Note that this change will only be effective once apply()
or applyAndDisplay()
is called.
removeAssertJRelatedElementsFromStackTrace
- whether AssertJ related elements are removed from assertion errors stack trace.public boolean lenientDateParsingEnabled()
See Assertions.setLenientDateParsing(boolean)
for a detailed description.
public void setLenientDateParsing(boolean lenientDateParsing)
See Assertions.setLenientDateParsing(boolean)
for a detailed description.
Note that this change will only be effective once apply()
or applyAndDisplay()
is called.
lenientDateParsing
- whether AssertJ will use lenient parsing mode for default date formats.public java.util.List<java.text.DateFormat> additionalDateFormats()
See Assertions.registerCustomDateFormat(java.text.DateFormat)
for a detailed description.
public void setAdditionalDateFormats(java.util.List<java.text.DateFormat> additionalDateFormats)
See Assertions.registerCustomDateFormat(java.text.DateFormat)
for a detailed description.
Note that this change will only be effective once apply()
or applyAndDisplay()
is called.
additionalDateFormats
- the date formats AssertJ will use in date assertions in addition the default ones.public void addAdditionalDateFormats(java.text.DateFormat... additionalDateFormats)
See Assertions.registerCustomDateFormat(java.text.DateFormat)
for a detailed description.
Note that this change will only be effective once apply()
or applyAndDisplay()
is called.
additionalDateFormats
- the date formats AssertJ will use in date assertions in addition the default ones.public int maxLengthForSingleLineDescription()
See Assertions.setMaxLengthForSingleLineDescription(int)
for a detailed description.
public void setMaxLengthForSingleLineDescription(int maxLengthForSingleLineDescription)
See Assertions.setMaxLengthForSingleLineDescription(int)
for a detailed description.
Note that this change will only be effective once apply()
or applyAndDisplay()
is called.
maxLengthForSingleLineDescription
- the maximum length for an iterable/array to be displayed on one line.public int maxElementsForPrinting()
See Assertions.setMaxLengthForSingleLineDescription(int)
for a detailed description.
public void setMaxElementsForPrinting(int maxElementsForPrinting)
See Assertions.setMaxLengthForSingleLineDescription(int)
for a detailed description.
Note that this change will only be effective once apply()
or applyAndDisplay()
is called.
maxElementsForPrinting
- the maximum length for an iterable/array to be displayed on one line.public void apply()
public void applyAndDisplay()
public java.lang.String describe()
private java.lang.String describeAdditionalDateFormats()
private java.lang.String describe(java.text.DateFormat dateFormat)