A (sub) set of commits.
This type is used to group together a set of commits that form a subgraph of
the complete commit graph. Like the complete graph, this subgraph will have a
single root()
node.
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescription@NotNull Commits
Add a commit to the graph.@NotNull Commits
addAll
(Collection<? extends Commit> commits) Add all commits to the graph.@NotNull Commits
Add all commits to the graph.@NotNull Commit
current()
The current node.@NotNull MigrationsType
export()
Export XML content from this commits graph.@Nullable Commit
@NotNull Commit
latest()
The latest node.@NotNull Commits
Load directory content into this commits graph.@NotNull Commits
load
(MigrationsType migrations) Load XML content into this commits graph.@NotNull Commit
root()
The root node.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
root
The root node. -
current
The current node.The current node is the node in the graph that has been installed in the database.
- Throws:
DataMigrationVerificationException
- In case there's no current node in the database, which can happen e.g. when no migration has been initialised yet, or when the currently installedNode.id()
is not part of this graph.
-
latest
The latest node.The latest node is the last node in the graph, if all branches have been merged successfully, or the latest node of the default branch, in case a default branch has been specified.
- Throws:
DataMigrationVerificationException
- In case there's no latest node, i.e. there's no default branch and branches haven't all been merged yet.
-
get
- Returns:
- The resulting
Commit
, ornull
, if the ID was not found.
-
add
Add a commit to the graph.- Returns:
- The same instance.
-
addAll
Add all commits to the graph.- Returns:
- The same instance.
-
addAll
Add all commits to the graph.- Returns:
- The same instance.
-
load
@NotNull @NotNull Commits load(File directory) throws IOException, DataMigrationVerificationException Load directory content into this commits graph.- Returns:
- The same instance.
- Throws:
IOException
- If anything goes wrong reading the directory contents.DataMigrationVerificationException
- If the migration verification fails.
-
load
Load XML content into this commits graph.- Returns:
- The same instance.
- Throws:
DataMigrationVerificationException
- If the migration verification fails.
-
export
Export XML content from this commits graph.
-