Created
August 24, 2020 21:59
-
-
Save ola0x/a1940e5ab8ece3ad207f6cf2baa54e6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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