com.redis.lettucemod.search.Suggestion Maven / Gradle / Ivy
package com.redis.lettucemod.search;
public class Suggestion {
private V string;
private Double score;
private V payload;
public Suggestion() {
}
private Suggestion(Builder builder) {
this.string = builder.string;
this.score = builder.score;
this.payload = builder.payload;
}
public V getString() {
return string;
}
public void setString(V string) {
this.string = string;
}
public Double getScore() {
return score;
}
public void setScore(Double score) {
this.score = score;
}
public V getPayload() {
return payload;
}
public void setPayload(V payload) {
this.payload = payload;
}
public static Suggestion of(V string, double score) {
Suggestion suggestion = new Suggestion<>();
suggestion.string = string;
suggestion.score = score;
return suggestion;
}
public static ScoreBuilder string(V string) {
return new ScoreBuilder<>(string);
}
public static class ScoreBuilder {
private final V string;
public ScoreBuilder(V string) {
this.string = string;
}
public Builder score(double score) {
return new Builder<>(string, score);
}
}
public static class Builder {
private final V string;
private final double score;
private V payload;
public Builder(V string, double score) {
this.string = string;
this.score = score;
}
public Builder payload(V payload) {
this.payload = payload;
return this;
}
public Suggestion build() {
return new Suggestion<>(this);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy