Package com.e1c.langtool.external.cache
Class TranslationQueryEntity
java.lang.Object
com.e1c.langtool.external.cache.TranslationQueryEntity
- All Implemented Interfaces:
Serializable
This class encapsulates the translation query.
In contrast to TranslationQuery
it contains an id of external translation services provider. This is in order to know
which provider translated this query. Due to this information it's easy to store and cache
translations. Also it doesn't have information about name processing.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTranslationQueryEntity(String providerId, String sourceLanguage, String targetLanguage, String text) Creates a new translation query. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic TranslationQueryEntityfromQuery(ISingleTranslationQuery query, String providerId) Creates a new translation query entity fromISingleTranslationQuery.Returns provider's id.Returns the source language of translated text.Returns the target language to translate.getText()Returns the text to translate.inthashCode()
-
Constructor Details
-
TranslationQueryEntity
public TranslationQueryEntity(String providerId, String sourceLanguage, String targetLanguage, String text) Creates a new translation query.- Parameters:
providerId- the id of provider that translating this querysourceLanguage- the language to translate fromtargetLanguage- the language to translate totext- the text to translate
-
-
Method Details
-
fromQuery
Creates a new translation query entity fromISingleTranslationQuery.- Parameters:
query- the translation queryproviderId- the id of provider that translating this query- Returns:
- translation query entity
- See Also:
-
getProviderId
Returns provider's id.- Returns:
- provider's id
-
getSourceLanguage
Returns the source language of translated text.- Returns:
- the source language of translated text
-
getTargetLanguage
Returns the target language to translate.- Returns:
- the target language to translate
-
getText
Returns the text to translate.- Returns:
- the text to translate
-
hashCode
public int hashCode() -
equals
-