Class CommentForValidation
java.lang.Object
com.google.gerrit.extensions.validators.CommentForValidation
Holds a comment's text and some metadata in order to pass it to a validation plugin.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumThe creator of the comment.static enumThe type of comment.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic CommentForValidationcreate(CommentForValidation.CommentSource source, CommentForValidation.CommentType type, String text, int size) failValidation(String message) abstract intReturns this instance's approximate size in bytes for the purpose of applying size limits.abstract CommentForValidation.CommentSourceabstract StringgetText()Returns the comment text.abstract CommentForValidation.CommentTypegetType()
- 
Constructor Details- 
CommentForValidationpublic CommentForValidation()
 
- 
- 
Method Details- 
createpublic static CommentForValidation create(CommentForValidation.CommentSource source, CommentForValidation.CommentType type, String text, int size) 
- 
getSource
- 
getType
- 
getTextReturns the comment text. Note that especially for robot comments the total size may be significantly larger and should be determined by usinggetApproximateSize().
- 
getApproximateSizepublic abstract int getApproximateSize()Returns this instance's approximate size in bytes for the purpose of applying size limits. For robot comments this may be significantly larger than the size of the comment text.
- 
failValidation
 
-