Skip to content

Instantly share code, notes, and snippets.

@ola0x
Created August 24, 2020 21:59
Show Gist options
  • Save ola0x/a1940e5ab8ece3ad207f6cf2baa54e6e to your computer and use it in GitHub Desktop.
Save ola0x/a1940e5ab8ece3ad207f6cf2baa54e6e to your computer and use it in GitHub Desktop.
public Result(final String id, final String title, final Float confidence) {
this.id = id;
this.title = title;
this.confidence = confidence;
}
public String getId() {
return id;
}
public String getTitle() {
return title;
}
public Float getConfidence() {
return confidence;
}
@Override
public String toString() {
String resultString = "";
if (id != null) {
resultString += "[" + id + "] ";
}
if (title != null) {
resultString += title + " ";
}
if (confidence != null) {
resultString += String.format("(%.1f%%) ", confidence * 100.0f);
}
return resultString.trim();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment