Line data Source code
1 : // Copyright (C) 2017 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.group.db; 16 : 17 : import com.google.auto.value.AutoValue; 18 : import com.google.gerrit.entities.AccountGroup; 19 : 20 : /** 21 : * Definition of all properties necessary for a group creation. 22 : * 23 : * <p>An instance of {@link InternalGroupCreation} is a blueprint for a group which should be 24 : * created. 25 : */ 26 : @AutoValue 27 152 : public abstract class InternalGroupCreation { 28 : 29 : /** Defines the numeric ID the group should have */ 30 : public abstract AccountGroup.Id getId(); 31 : 32 : /** Defines the name the group should have */ 33 : public abstract AccountGroup.NameKey getNameKey(); 34 : 35 : /** Defines the UUID the group should have */ 36 : public abstract AccountGroup.UUID getGroupUUID(); 37 : 38 : public static Builder builder() { 39 152 : return new AutoValue_InternalGroupCreation.Builder(); 40 : } 41 : 42 : @AutoValue.Builder 43 152 : public abstract static class Builder { 44 : /** Defines the name the group should have */ 45 : public abstract InternalGroupCreation.Builder setId(AccountGroup.Id id); 46 : 47 : /** Defines the name the group should have */ 48 : public abstract InternalGroupCreation.Builder setNameKey(AccountGroup.NameKey name); 49 : 50 : /** Defines the UUID the group should have */ 51 : public abstract InternalGroupCreation.Builder setGroupUUID(AccountGroup.UUID groupUuid); 52 : 53 : public abstract InternalGroupCreation build(); 54 : } 55 : }