Package org.approvej.configuration
Record Class Configuration
java.lang.Object
java.lang.Record
org.approvej.configuration.Configuration
- Record Components:
defaultPrintFormat- thePrintFormatthat will be used if none is specified otherwisedefaultFileReviewer- theReviewerthat will be used for file-based approvals if none is specifiedinventoryEnabled- whether the approved file inventory is enableddefaultInlineValueReviewer- theReviewerthat will be used for inline value approvals if none is specified
@NullMarked
public record Configuration(PrintFormat<Object> defaultPrintFormat, Reviewer defaultFileReviewer, boolean inventoryEnabled, Reviewer defaultInlineValueReviewer)
extends Record
Central configuration class for ApproveJ.
Configuration values can be set through multiple mechanisms, with the following priority (highest to lowest):
- Environment variables (e.g.,
APPROVEJ_DEFAULT_PRINT_FORMAT) - Project properties (
src/test/resources/approvej.properties) - User home properties (
~/.config/approvej/approvej.properties) - Default values
Print formats and reviewers can be configured using either:
- Aliases (e.g., "json", "yaml", "singleLineString", "multiLineString" for print formats; "none", "automatic", "script", "ai" for reviewers)
- Fully-qualified class names (for backward compatibility and custom implementations)
The "script" reviewer requires the reviewerScript property to be set. The "ai"
reviewer requires the reviewerAiCommand property to be set.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConfiguration(PrintFormat<Object> defaultPrintFormat, Reviewer defaultFileReviewer, boolean inventoryEnabled, Reviewer defaultInlineValueReviewer) Creates an instance of aConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedefaultFileReviewerrecord component.Returns the value of thedefaultInlineValueReviewerrecord component.Returns the value of thedefaultPrintFormatrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinventoryEnabledrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
configuration
The loadedConfigurationobject.
-
-
Constructor Details
-
Configuration
public Configuration(PrintFormat<Object> defaultPrintFormat, Reviewer defaultFileReviewer, boolean inventoryEnabled, Reviewer defaultInlineValueReviewer) Creates an instance of aConfigurationrecord class.- Parameters:
defaultPrintFormat- the value for thedefaultPrintFormatrecord componentdefaultFileReviewer- the value for thedefaultFileReviewerrecord componentinventoryEnabled- the value for theinventoryEnabledrecord componentdefaultInlineValueReviewer- the value for thedefaultInlineValueReviewerrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
defaultPrintFormat
Returns the value of thedefaultPrintFormatrecord component.- Returns:
- the value of the
defaultPrintFormatrecord component
-
defaultFileReviewer
Returns the value of thedefaultFileReviewerrecord component.- Returns:
- the value of the
defaultFileReviewerrecord component
-
inventoryEnabled
public boolean inventoryEnabled()Returns the value of theinventoryEnabledrecord component.- Returns:
- the value of the
inventoryEnabledrecord component
-
defaultInlineValueReviewer
Returns the value of thedefaultInlineValueReviewerrecord component.- Returns:
- the value of the
defaultInlineValueReviewerrecord component
-