2022-03-02 12:34:30 +01:00
|
|
|
package it.cavallium.dbengine.database.remote;
|
|
|
|
|
|
|
|
import it.cavallium.data.generator.DataSerializer;
|
|
|
|
import it.cavallium.dbengine.lucene.analyzer.TextFieldsSimilarity;
|
|
|
|
import java.io.DataInput;
|
|
|
|
import java.io.DataOutput;
|
|
|
|
import java.io.IOException;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
|
|
|
|
public class TextFieldsSimilaritySerializer implements DataSerializer<TextFieldsSimilarity> {
|
|
|
|
|
|
|
|
@Override
|
2023-02-09 23:34:25 +01:00
|
|
|
public void serialize(DataOutput dataOutput, @NotNull TextFieldsSimilarity textFieldsSimilarity) {
|
2022-03-02 12:34:30 +01:00
|
|
|
dataOutput.writeInt(textFieldsSimilarity.ordinal());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-09 23:34:25 +01:00
|
|
|
public @NotNull TextFieldsSimilarity deserialize(DataInput dataInput) {
|
2022-03-02 12:34:30 +01:00
|
|
|
return TextFieldsSimilarity.values()[dataInput.readInt()];
|
|
|
|
}
|
|
|
|
}
|