Class Thesaurus
- java.lang.Object
-
- com.tibco.patterns.learn.api.feature.Thesaurus
-
public final class Thesaurus extends java.lang.ObjectRepresents thesaurus file that can be used in multiple querylets. Holds thesaurus file name and type. Immutable class. Can load the thesaurus to a Patterns server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classThesaurus.TypeThe type of a thesaurus file.
-
Constructor Summary
Constructors Constructor Description Thesaurus(java.lang.String fileName)Creates Thesaurus using the default thesaurus type SUBSTITUTION.Thesaurus(java.lang.String fileName, Thesaurus.Type type)Creates Thesaurus with the given name and type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateOnServer(com.netrics.likeit.NetricsServerInterface server, java.lang.String serverThesName, java.nio.file.Path thesDir)Creates the thesaurus of the appropriate type on the Patterns server.booleanequals(java.lang.Object obj)java.lang.StringgetName()Thesaurus.TypegetType()inthashCode()Hash code uses thesaurus name only.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Thesaurus
public Thesaurus(java.lang.String fileName, Thesaurus.Type type)Creates Thesaurus with the given name and type.- Parameters:
fileName- - the file name of the thesaurus.
-
Thesaurus
public Thesaurus(java.lang.String fileName)
Creates Thesaurus using the default thesaurus type SUBSTITUTION.- See Also:
Thesaurus(String, Type)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
createOnServer
public void createOnServer(com.netrics.likeit.NetricsServerInterface server, java.lang.String serverThesName, java.nio.file.Path thesDir) throws java.io.IOException, com.netrics.likeit.NetricsExceptionCreates the thesaurus of the appropriate type on the Patterns server.- Parameters:
server- - the Patterns server to load the thesaurus. Not null.serverThesName- - the name of the new thesaurus on the server. Not null.thesDir- - the directory that has the thesaurus file. Not null.- Throws:
com.netrics.likeit.NetricsException- if an error occured on server.java.io.IOException- if the server does not exist, is not accessible, or if an I/O error occurs while communicating with server.
-
getName
public java.lang.String getName()
- Returns:
- the name of the thesaurus file (not null).
-
getType
public Thesaurus.Type getType()
- Returns:
- the type of the thesaurus file (not null).
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- Returns:
- true if the thesaurus names are equal.
-
hashCode
public int hashCode()
Hash code uses thesaurus name only.- Overrides:
hashCodein classjava.lang.Object
-
-