Line data Source code
1 : // Copyright (C) 2016 The Android Open Source Project 2 : // 3 : // Licensed under the Apache License, Version 2.0 (the "License"); 4 : // you may not use this file except in compliance with the License. 5 : // You may obtain a copy of the License at 6 : // 7 : // http://www.apache.org/licenses/LICENSE-2.0 8 : // 9 : // Unless required by applicable law or agreed to in writing, software 10 : // distributed under the License is distributed on an "AS IS" BASIS, 11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : // See the License for the specific language governing permissions and 13 : // limitations under the License. 14 : 15 : package com.google.gerrit.extensions.api.changes; 16 : 17 : import com.google.common.base.MoreObjects; 18 : import java.util.List; 19 : import java.util.Objects; 20 : 21 : /** Detailed information about who should be notified about an update. */ 22 : public class NotifyInfo { 23 : public List<String> accounts; 24 : 25 : /** 26 : * @param accounts may be either just a list of: account IDs, Full names, usernames, or emails. 27 : * Also could be a list of those: "Full name <email@example.com>" or "Full name (<ID>)" 28 : */ 29 11 : public NotifyInfo(List<String> accounts) { 30 11 : this.accounts = accounts; 31 11 : } 32 : 33 : @Override 34 : public boolean equals(Object o) { 35 0 : if (!(o instanceof NotifyInfo)) { 36 0 : return false; 37 : } 38 0 : NotifyInfo other = (NotifyInfo) o; 39 0 : return Objects.equals(other.accounts, accounts); 40 : } 41 : 42 : @Override 43 : public int hashCode() { 44 0 : return Objects.hash(accounts); 45 : } 46 : 47 : @Override 48 : public String toString() { 49 0 : return MoreObjects.toStringHelper(this).add("accounts", accounts).toString(); 50 : } 51 : }