Package org.languagetool.remote
Class RemoteRuleMatch
- java.lang.Object
-
- org.languagetool.remote.RemoteRuleMatch
-
public class RemoteRuleMatch extends java.lang.Object
A potential error as returned by the HTTP API of LanguageTool.- Since:
- 3.4
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
category
private java.lang.String
categoryId
private java.lang.String
context
private int
contextOffset
private int
errorLength
private java.lang.String
locQualityIssueType
private java.lang.String
msg
private int
offset
private java.util.List<java.lang.String>
replacements
private java.lang.String
ruleDescription
private java.lang.String
ruleId
private java.lang.String
shortMsg
private java.lang.String
subId
private java.lang.String
url
-
Constructor Summary
Constructors Constructor Description RemoteRuleMatch(java.lang.String ruleId, java.lang.String ruleDescription, java.lang.String msg, java.lang.String context, int contextOffset, int offset, int errorLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
getCategory()
The error's category.java.util.Optional<java.lang.String>
getCategoryId()
The id of the error's category.java.lang.String
getContext()
The error in its context.int
getContextOffset()
The character position of the error start inside the result ofgetContext()
.int
getErrorLength()
The length of the error in characters.int
getErrorOffset()
The character position where the error starts.java.util.Optional<java.lang.String>
getLocQualityIssueType()
java.lang.String
getMessage()
A text describing the error to the user.java.util.Optional<java.util.List<java.lang.String>>
getReplacements()
Potential corrections for the error.java.lang.String
getRuleDescription()
Description of the rule.java.lang.String
getRuleId()
Unique (per language) identifier for the error.java.util.Optional<java.lang.String>
getRuleSubId()
Optional sub id (rule groups have a sub id for each rule).java.util.Optional<java.lang.String>
getShortMessage()
Optional short message describing the error.java.util.Optional<java.lang.String>
getUrl()
URL with a more detailed explanation of the error.(package private) void
setCategory(java.lang.String category)
(package private) void
setCategoryId(java.lang.String categoryId)
(package private) void
setLocQualityIssueType(java.lang.String locQualityIssueType)
(package private) void
setReplacements(java.util.List<java.lang.String> replacements)
(package private) void
setRuleSubId(java.lang.String subId)
(package private) void
setShortMsg(java.lang.String shortMsg)
(package private) void
setUrl(java.lang.String url)
java.lang.String
toString()
-
-
-
Field Detail
-
ruleId
private final java.lang.String ruleId
-
ruleDescription
private final java.lang.String ruleDescription
-
msg
private final java.lang.String msg
-
context
private final java.lang.String context
-
contextOffset
private final int contextOffset
-
offset
private final int offset
-
errorLength
private final int errorLength
-
subId
private java.lang.String subId
-
shortMsg
private java.lang.String shortMsg
-
replacements
private java.util.List<java.lang.String> replacements
-
url
private java.lang.String url
-
category
private java.lang.String category
-
categoryId
private java.lang.String categoryId
-
locQualityIssueType
private java.lang.String locQualityIssueType
-
-
Method Detail
-
getRuleId
public java.lang.String getRuleId()
Unique (per language) identifier for the error.
-
getRuleDescription
public java.lang.String getRuleDescription()
Description of the rule.
-
getRuleSubId
public java.util.Optional<java.lang.String> getRuleSubId()
Optional sub id (rule groups have a sub id for each rule).
-
getMessage
public java.lang.String getMessage()
A text describing the error to the user.
-
getShortMessage
public java.util.Optional<java.lang.String> getShortMessage()
Optional short message describing the error.
-
getReplacements
public java.util.Optional<java.util.List<java.lang.String>> getReplacements()
Potential corrections for the error. Note that corrections might be wrong and they are not necessarily ordered by quality.
-
getContext
public java.lang.String getContext()
The error in its context. SeegetContextOffset()
andgetErrorLength()
to get the exact position.
-
getContextOffset
public int getContextOffset()
The character position of the error start inside the result ofgetContext()
.
-
getErrorOffset
public int getErrorOffset()
The character position where the error starts.
-
getErrorLength
public int getErrorLength()
The length of the error in characters.
-
getUrl
public java.util.Optional<java.lang.String> getUrl()
URL with a more detailed explanation of the error.
-
getCategory
public java.util.Optional<java.lang.String> getCategory()
The error's category.
-
getCategoryId
public java.util.Optional<java.lang.String> getCategoryId()
The id of the error's category.
-
getLocQualityIssueType
public java.util.Optional<java.lang.String> getLocQualityIssueType()
-
setRuleSubId
void setRuleSubId(java.lang.String subId)
-
setShortMsg
void setShortMsg(java.lang.String shortMsg)
-
setReplacements
void setReplacements(java.util.List<java.lang.String> replacements)
-
setUrl
void setUrl(java.lang.String url)
-
setCategory
void setCategory(java.lang.String category)
-
setCategoryId
void setCategoryId(java.lang.String categoryId)
-
setLocQualityIssueType
void setLocQualityIssueType(java.lang.String locQualityIssueType)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-