Document Prolog predicate classes For describing predicate parameters in the javadoc we use '+' as indicator for input mode and '-' as indicator for output mode (see [1,2]). [1] https://www.swi-prolog.org/pldoc/man?section=preddesc [2] https://stackoverflow.com/questions/4220651/question-mark-plus-minus-preceding-prolog-variable-names Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I3195563311fbca02b7f42100fa1e90a8fc90746d
diff --git a/java/gerrit/AbstractCommitUserIdentityPredicate.java b/java/gerrit/AbstractCommitUserIdentityPredicate.java index bd8cf1a..51c4a3b 100644 --- a/java/gerrit/AbstractCommitUserIdentityPredicate.java +++ b/java/gerrit/AbstractCommitUserIdentityPredicate.java
@@ -30,6 +30,20 @@ import java.io.IOException; import org.eclipse.jgit.lib.PersonIdent; +/** + * Abstract Prolog predicate for a Git person identity of a change. + * + * <p>Checks that the terms that are provided as input to this Prolog predicate match a Git person + * identity of the change (either author or committer). + * + * <p>The terms that are provided as input to this Prolog predicate are: + * + * <ul> + * <li>a user ID term that matches the account ID of the Git person identity + * <li>a string atom that matches the full name of the Git person identity + * <li>a string atom that matches the email of the Git person identity + * </ul> + */ abstract class AbstractCommitUserIdentityPredicate extends Predicate.P3 { private static final SymbolTerm user = SymbolTerm.intern("user", 1); private static final SymbolTerm anonymous = SymbolTerm.intern("anonymous");
diff --git a/java/gerrit/PRED_change_branch_1.java b/java/gerrit/PRED_change_branch_1.java index 4501169..62744f7 100644 --- a/java/gerrit/PRED_change_branch_1.java +++ b/java/gerrit/PRED_change_branch_1.java
@@ -23,6 +23,16 @@ import com.googlecode.prolog_cafe.lang.SymbolTerm; import com.googlecode.prolog_cafe.lang.Term; +/** + * Prolog predicate for the destination branch of a change. + * + * <p>Checks that the term that is provided as input to this Prolog predicate is a string atom that + * matches the destination branch of the change. + * + * <pre> + * 'change_branch'(-Branch) + * </pre> + */ public class PRED_change_branch_1 extends Predicate.P1 { public PRED_change_branch_1(Term a1, Operation n) { arg1 = a1;
diff --git a/java/gerrit/PRED_change_owner_1.java b/java/gerrit/PRED_change_owner_1.java index d42c0e1..f6fbb80 100644 --- a/java/gerrit/PRED_change_owner_1.java +++ b/java/gerrit/PRED_change_owner_1.java
@@ -25,6 +25,16 @@ import com.googlecode.prolog_cafe.lang.SymbolTerm; import com.googlecode.prolog_cafe.lang.Term; +/** + * Prolog predicate for the owner of a change. + * + * <p>Checks that the term that is provided as input to this Prolog predicate is a user ID term that + * matches the account ID of the change owner. + * + * <pre> + * 'change_owner'(user(-ID)) + * </pre> + */ public class PRED_change_owner_1 extends Predicate.P1 { private static final SymbolTerm user = SymbolTerm.intern("user", 1);
diff --git a/java/gerrit/PRED_change_project_1.java b/java/gerrit/PRED_change_project_1.java index a973e1c..b2ef109 100644 --- a/java/gerrit/PRED_change_project_1.java +++ b/java/gerrit/PRED_change_project_1.java
@@ -23,6 +23,16 @@ import com.googlecode.prolog_cafe.lang.SymbolTerm; import com.googlecode.prolog_cafe.lang.Term; +/** + * Prolog predicate for the project of a change. + * + * <p>Checks that the term that is provided as input to this Prolog predicate is a string atom that + * matches the project of the change. + * + * <pre> + * 'change_project'(-Project) + * </pre> + */ public class PRED_change_project_1 extends Predicate.P1 { public PRED_change_project_1(Term a1, Operation n) { arg1 = a1;
diff --git a/java/gerrit/PRED_change_topic_1.java b/java/gerrit/PRED_change_topic_1.java index 11d737a..f0175ef 100644 --- a/java/gerrit/PRED_change_topic_1.java +++ b/java/gerrit/PRED_change_topic_1.java
@@ -23,6 +23,16 @@ import com.googlecode.prolog_cafe.lang.SymbolTerm; import com.googlecode.prolog_cafe.lang.Term; +/** + * Prolog predicate for the topic of a change. + * + * <p>Checks that the term that is provided as input to this Prolog predicate is a string atom that + * matches the topic of the change. + * + * <pre> + * 'change_topic'(-Topic) + * </pre> + */ public class PRED_change_topic_1 extends Predicate.P1 { public PRED_change_topic_1(Term a1, Operation n) { arg1 = a1;
diff --git a/java/gerrit/PRED_commit_author_3.java b/java/gerrit/PRED_commit_author_3.java index 998b30e..3381344 100644 --- a/java/gerrit/PRED_commit_author_3.java +++ b/java/gerrit/PRED_commit_author_3.java
@@ -21,6 +21,27 @@ import com.googlecode.prolog_cafe.lang.Term; import org.eclipse.jgit.revwalk.RevCommit; +/** + * Prolog predicate for the Git author of the current patch set of a change. + * + * <p>Checks that the terms that are provided as input to this Prolog predicate match the Git author + * of the current patch set of the change. + * + * <p>The terms that are provided as input to this Prolog predicate are: + * + * <ul> + * <li>a user ID term that matches the account ID of the Git author of the current patch set of + * the change + * <li>a string atom that matches the full name of the Git author of the current patch set of the + * change + * <li>a string atom that matches the email of the Git author of the current patch set of the + * change + * </ul> + * + * <pre> + * 'commit_author'(user(-ID), -FullName, -Email) + * </pre> + */ public class PRED_commit_author_3 extends AbstractCommitUserIdentityPredicate { public PRED_commit_author_3(Term a1, Term a2, Term a3, Operation n) { super(a1, a2, a3, n);
diff --git a/java/gerrit/PRED_commit_committer_3.java b/java/gerrit/PRED_commit_committer_3.java index 293d8ce..1757336 100644 --- a/java/gerrit/PRED_commit_committer_3.java +++ b/java/gerrit/PRED_commit_committer_3.java
@@ -21,6 +21,27 @@ import com.googlecode.prolog_cafe.lang.Term; import org.eclipse.jgit.revwalk.RevCommit; +/** + * Prolog predicate for the Git committer of the current patch set of a change. + * + * <p>Checks that the terms that are provided as input to this Prolog predicate match the Git + * committer of the current patch set of the change. + * + * <p>The terms that are provided as input to this Prolog predicate are: + * + * <ul> + * <li>a user ID term that matches the account ID of the Git committer of the current patch set of + * the change + * <li>a string atom that matches the full name of the Git committer of the current patch set of + * the change + * <li>a string atom that matches the email of the Git committer of the current patch set of the + * change + * </ul> + * + * <pre> + * 'commit_committer'(user(-ID), -FullName, -Email) + * </pre> + */ public class PRED_commit_committer_3 extends AbstractCommitUserIdentityPredicate { public PRED_commit_committer_3(Term a1, Term a2, Term a3, Operation n) { super(a1, a2, a3, n);
diff --git a/java/gerrit/PRED_commit_message_1.java b/java/gerrit/PRED_commit_message_1.java index eb996d6..3485af6 100644 --- a/java/gerrit/PRED_commit_message_1.java +++ b/java/gerrit/PRED_commit_message_1.java
@@ -24,7 +24,10 @@ import org.eclipse.jgit.revwalk.RevCommit; /** - * Returns the commit message as a symbol + * Prolog predicate for the commit message of a change. + * + * <p>Checks that the term that is provided as input to this Prolog predicate is a string atom that + * matches the commit message of the change. * * <pre> * 'commit_message'(-Msg)
diff --git a/java/gerrit/PRED_project_default_submit_type_1.java b/java/gerrit/PRED_project_default_submit_type_1.java index d70a9e4..77a0261 100644 --- a/java/gerrit/PRED_project_default_submit_type_1.java +++ b/java/gerrit/PRED_project_default_submit_type_1.java
@@ -24,6 +24,16 @@ import com.googlecode.prolog_cafe.lang.SymbolTerm; import com.googlecode.prolog_cafe.lang.Term; +/** + * Prolog predicate for the default submit type of the project of a change. + * + * <p>Checks that the term that is provided as input to this Prolog predicate is a string atom that + * matches the default submit type of the change's project. + * + * <pre> + * 'project_default_submit_type'(-SubmitType) + * </pre> + */ public class PRED_project_default_submit_type_1 extends Predicate.P1 { private static final SymbolTerm[] term;
diff --git a/java/gerrit/PRED_pure_revert_1.java b/java/gerrit/PRED_pure_revert_1.java index 6300a668..19e7b68 100644 --- a/java/gerrit/PRED_pure_revert_1.java +++ b/java/gerrit/PRED_pure_revert_1.java
@@ -22,7 +22,17 @@ import com.googlecode.prolog_cafe.lang.Prolog; import com.googlecode.prolog_cafe.lang.Term; -/** Checks if change is a pure revert of the change it references in 'revertOf'. */ +/** + * Prolog Predicate that checks if the change is a pure revert of the change it references in + * 'revertOf'. + * + * <p>The input is an integer atom where '1' represents a pure revert and '0' represents a non-pure + * revert. + * + * <pre> + * 'pure_revert'(-PureRevert) + * </pre> + */ public class PRED_pure_revert_1 extends Predicate.P1 { public PRED_pure_revert_1(Term a1, Operation n) { arg1 = a1;
diff --git a/java/gerrit/PRED_unresolved_comments_count_1.java b/java/gerrit/PRED_unresolved_comments_count_1.java index d4abcc54..9a1fcca 100644 --- a/java/gerrit/PRED_unresolved_comments_count_1.java +++ b/java/gerrit/PRED_unresolved_comments_count_1.java
@@ -22,6 +22,16 @@ import com.googlecode.prolog_cafe.lang.Prolog; import com.googlecode.prolog_cafe.lang.Term; +/** + * Prolog predicate for the number of unresolved comments of a change. + * + * <p>Checks that the term that is provided as input to this Prolog predicate is an integer atom + * that matches the number of unresolved comments of the change. + * + * <pre> + * 'unresolved_comments_count'(-NumberOfUnresolvedComments) + * </pre> + */ public class PRED_unresolved_comments_count_1 extends Predicate.P1 { public PRED_unresolved_comments_count_1(Term a1, Operation n) { arg1 = a1;
diff --git a/java/gerrit/PRED_uploader_1.java b/java/gerrit/PRED_uploader_1.java index 681d86c..89e367e 100644 --- a/java/gerrit/PRED_uploader_1.java +++ b/java/gerrit/PRED_uploader_1.java
@@ -27,6 +27,16 @@ import com.googlecode.prolog_cafe.lang.SymbolTerm; import com.googlecode.prolog_cafe.lang.Term; +/** + * Prolog predicate for the uploader of the current patch set of a change. + * + * <p>Checks that the term that is provided as input to this Prolog predicate is a user ID term that + * matches the account ID of the uploader of the current patch set. + * + * <pre> + * 'uploader'(user(-ID)) + * </pre> + */ public class PRED_uploader_1 extends Predicate.P1 { private static final FluentLogger logger = FluentLogger.forEnclosingClass();