public class ConventionalCommit extends Object
Conventional commit message representation.
Based on specification Conventional Commits v1.0.0.
| Modifier and Type | Class and Description |
|---|---|
static class |
ConventionalCommit.Builder
Builder to ease conventional commit creation.
|
| Constructor and Description |
|---|
ConventionalCommit(String type,
String description)
Simple constructor.
|
ConventionalCommit(String type,
String scope,
boolean exclamation,
String description,
String body,
Map<String,String> footer)
All arguments constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Optional<String> |
body()
Message body.
|
boolean |
breakingChange()
Indicator of breaking change.
|
String |
description()
Message description.
|
boolean |
exclamation()
Message with exclamation mark.
|
Map<String,String> |
footer()
Key/value footer list.
|
Optional<String> |
scope()
Message scope.
|
String |
toString()
Generate conventional commit message.
|
String |
type()
Message type.
|
public ConventionalCommit(String type, String scope, boolean exclamation, String description, String body, Map<String,String> footer)
type - Message type; must be one of the following values: fix, feat, build, chore, ci, docs, style, refactor, perf, or testscope - Custom message scope; might be nullexclamation - true if exclamation mark appears in the message, false otherwisedescription - Message descriptionbody - Full message body, might be multilinefooter - Key/value list of additional dataIllegalStateException - If type or description is null or emptypublic ConventionalCommit(String type, String description)
type - Message type; must be one of the following values: fix, feat, build, chore, ci, docs, style, refactor, perf, or testdescription - Message descriptionIllegalStateException - If type or description is null or emptypublic String type()
public Optional<String> scope()
Optional with message scope; empty if it does not existpublic boolean exclamation()
true if exclamation mark exists in message, false otherwisepublic String description()
public Optional<String> body()
Optional with message body; empty if it does not existpublic Map<String,String> footer()
Map representing footer key/valuepublic boolean breakingChange()
true if breaking change, false otherwiseCopyright © 2022. All rights reserved.