@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.language.v1beta2.Sentiment)) { return super.equals(obj); } com.google.cloud.language.v1beta2.Sentiment other = (com.google.cloud.language.v1beta2.Sentiment) obj; boolean result = true; result = result && (java.lang.Float.floatToIntBits(getMagnitude()) == java.lang.Float.floatToIntBits(other.getMagnitude())); result = result && (java.lang.Float.floatToIntBits(getScore()) == java.lang.Float.floatToIntBits(other.getScore())); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + MAGNITUDE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getMagnitude()); hash = (37 * hash) + SCORE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getScore()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(com.google.cloud.language.v1beta2.Sentiment other) { if (other == com.google.cloud.language.v1beta2.Sentiment.getDefaultInstance()) return this; if (other.getMagnitude() != 0F) { setMagnitude(other.getMagnitude()); } if (other.getScore() != 0F) { setScore(other.getScore()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
if (sentiment != null) { System.out.println("Found sentiment."); System.out.printf("\tMagnitude: %.3f\n", sentiment.getMagnitude()); System.out.printf("\tScore: %.3f\n", sentiment.getScore()); } else {