public static FinishReason forNumber(int value) {
      switch (value) {
        case 0:
          return FINISH_REASON_UNSPECIFIED;
        case 1:
          return STOP;
        case 2:
          return MAX_TOKENS;
        case 3:
          return SAFETY;
        case 4:
          return RECITATION;
        case 5:
          return OTHER;
        case 6:
          return BLOCKLIST;
        case 7:
          return PROHIBITED_CONTENT;
        case 8:
          return SPII;
        case 9:
          return MALFORMED_FUNCTION_CALL;
        default:
          return null;
      }
    }
@param value The numeric wire value of the corresponding enum entry.
@return The enum associated with the given numeric wire value.
java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Candidate.java