Line data Source code
1 : // Copyright (C) 2012 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.server.git; 16 : 17 : import java.util.ArrayList; 18 : import java.util.List; 19 : import org.eclipse.jgit.lib.ObjectId; 20 : 21 : /** The outcome of the {@link com.google.gerrit.server.git.BanCommit} operation. */ 22 2 : public class BanCommitResult { 23 2 : private final List<ObjectId> newlyBannedCommits = new ArrayList<>(4); 24 2 : private final List<ObjectId> alreadyBannedCommits = new ArrayList<>(4); 25 2 : private final List<ObjectId> ignoredObjectIds = new ArrayList<>(4); 26 : 27 : public void commitBanned(ObjectId commitId) { 28 2 : newlyBannedCommits.add(commitId); 29 2 : } 30 : 31 : public void commitAlreadyBanned(ObjectId commitId) { 32 1 : alreadyBannedCommits.add(commitId); 33 1 : } 34 : 35 : public void notACommit(ObjectId id) { 36 0 : ignoredObjectIds.add(id); 37 0 : } 38 : 39 : public List<ObjectId> getNewlyBannedCommits() { 40 2 : return newlyBannedCommits; 41 : } 42 : 43 : public List<ObjectId> getAlreadyBannedCommits() { 44 2 : return alreadyBannedCommits; 45 : } 46 : 47 : public List<ObjectId> getIgnoredObjectIds() { 48 2 : return ignoredObjectIds; 49 : } 50 : }