Line data Source code
1 : // Copyright (C) 2015 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.common; 16 : 17 : import java.sql.Timestamp; 18 : import java.time.Instant; 19 : import java.util.List; 20 : 21 39 : public class GroupInfo extends GroupBaseInfo { 22 : public String url; 23 : public GroupOptionsInfo options; 24 : 25 : // These fields are only supplied for internal groups. 26 : public String description; 27 : public Integer groupId; 28 : public String owner; 29 : public String ownerId; 30 : 31 : // TODO(issue-15508): Migrate timestamp fields in *Info/*Input classes from type Timestamp to 32 : // Instant 33 : public Timestamp createdOn; 34 : 35 : public Boolean _moreGroups; 36 : 37 : // These fields are only supplied for internal groups, and only if requested. 38 : public List<AccountInfo> members; 39 : public List<GroupInfo> includes; 40 : 41 : // TODO(issue-15508): Migrate timestamp fields in *Info/*Input classes from type Timestamp to 42 : // Instant 43 : @SuppressWarnings("JdkObsolete") 44 : public Instant getCreatedOn() { 45 0 : return createdOn.toInstant(); 46 : } 47 : 48 : // TODO(issue-15508): Migrate timestamp fields in *Info/*Input classes from type Timestamp to 49 : // Instant 50 : @SuppressWarnings("JdkObsolete") 51 : public void setCreatedOn(Instant when) { 52 36 : createdOn = Timestamp.from(when); 53 36 : } 54 : }