public static String partitionStateToStr(PartitionState partitionState) {
    String partitionStateStr = null;
    switch (partitionState) {
      case READ_WRITE:
        partitionStateStr = READ_WRITE_STR;
        break;
      case PARTIAL_READ_WRITE:
        partitionStateStr = PARTIAL_READ_WRITE_STR;
        break;
      case READ_ONLY:
        partitionStateStr = READ_ONLY_STR;
        break;
      default:
        throw new IllegalArgumentException(String.format("Invalid partition state %s", partitionState.name()));
    }
    return partitionStateStr;
  }
Convert {@link PartitionState} object to str.
@param partitionState {@link PartitionState} to convert.
@return String representation for {@link PartitionState}.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/ClusterMapUtils.java