Class CommentForValidation
- java.lang.Object
-
- com.google.gerrit.extensions.validators.CommentForValidation
-
public abstract class CommentForValidation extends Object
Holds a comment's text and some metadata in order to pass it to a validation plugin.- See Also:
CommentValidator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CommentForValidation.CommentSource
The creator of the comment.static class
CommentForValidation.CommentType
The type of comment.
-
Constructor Summary
Constructors Constructor Description CommentForValidation()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CommentForValidation
create(CommentForValidation.CommentSource source, CommentForValidation.CommentType type, String text, int size)
CommentValidationFailure
failValidation(String message)
abstract int
getApproximateSize()
Returns this instance's approximate size in bytes for the purpose of applying size limits.abstract CommentForValidation.CommentSource
getSource()
abstract String
getText()
Returns the comment text.abstract CommentForValidation.CommentType
getType()
-
-
-
Method Detail
-
create
public static CommentForValidation create(CommentForValidation.CommentSource source, CommentForValidation.CommentType type, String text, int size)
-
getSource
public abstract CommentForValidation.CommentSource getSource()
-
getType
public abstract CommentForValidation.CommentType getType()
-
getText
public abstract String getText()
Returns the comment text. Note that especially for robot comments the total size may be significantly larger and should be determined by usinggetApproximateSize()
.
-
getApproximateSize
public 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
public CommentValidationFailure failValidation(String message)
-
-