Package com.e1c.langtool.query
Class SingleTranslationQuery
java.lang.Object
com.e1c.langtool.query.TranslationQuery
com.e1c.langtool.query.SingleTranslationQuery
- All Implemented Interfaces:
ISingleTranslationQuery
public final class SingleTranslationQuery
extends TranslationQuery
implements ISingleTranslationQuery
Encapsulates a translation query for single text.
SingleTranslationQuery is an immutable and thread-safe class.
- See Also:
-
ITranslationQuery
-
Method Summary
Modifier and TypeMethodDescriptionstatic ISingleTranslationQuerycreateQuery(String text, String sourceLocale, String targetLocale) Creates a new translation query with processing for single text.static ISingleTranslationQuerycreateQuery(String text, String sourceLocale, String targetLocale, boolean isProcessing) Creates a new translation query for single text.booleanReturns the code of source language of text.Returns the code of target language to translate.getText()Returns the text to translate.inthashCode()booleanReturns true if the text (or texts) needs of processing.toString()Methods inherited from class com.e1c.langtool.query.TranslationQuery
getSourceLanguage, getTargetLanguage, isProcessingNeeded
-
Method Details
-
createQuery
public static ISingleTranslationQuery createQuery(String text, String sourceLocale, String targetLocale, boolean isProcessing) Creates a new translation query for single text.- Parameters:
text- the text to translatesourceLocale- the source language of texttargetLocale- the target language to translateisProcessing- information text processing is needed or not- Returns:
- a new translation query for single text
- Throws:
IllegalArgumentException- if the value of any argument is null
-
createQuery
public static ISingleTranslationQuery createQuery(String text, String sourceLocale, String targetLocale) Creates a new translation query with processing for single text.- Parameters:
text- the text to translatesourceLocale- the source language of texttargetLocale- the target language to translate- Returns:
- a new translation query for single text
- Throws:
IllegalArgumentException- if the value of any argument is null
-
getText
Description copied from interface:ISingleTranslationQueryReturns the text to translate.- Specified by:
getTextin interfaceISingleTranslationQuery- Returns:
- the text to translate. Can't be
null.
-
hashCode
public int hashCode()- Overrides:
hashCodein classTranslationQuery
-
equals
- Overrides:
equalsin classTranslationQuery
-
toString
-
getSourceLanguage
String getSourceLanguage()Returns the code of source language of text.- Returns:
- the code of source language. Can't be
null.
-
getTargetLanguage
String getTargetLanguage()Returns the code of target language to translate.- Returns:
- the code of target language to translate. Can't be
null.
-
isProcessingNeeded
boolean isProcessingNeeded()Returns true if the text (or texts) needs of processing.- Returns:
- true if the text (or texts) needs of processing
-