// Copyright (C) 2022 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.k8s.operator.cluster;

import java.util.List;
import java.util.Map;

public class GerritClusterStatus {
  private Map<String, List<String>> members;

  public Map<String, List<String>> getMembers() {
    return members;
  }

  public void setMembers(Map<String, List<String>> members) {
    this.members = members;
  }
}
