Line data Source code
1 : // Copyright (C) 2018 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 : 20 : /** 21 : * Representation of a (detailed) account in the REST API. 22 : * 23 : * <p>This class determines the JSON format of (detailed) accounts in the REST API. 24 : * 25 : * <p>This class extends {@link AccountInfo} (which defines fields for account properties that are 26 : * frequently used) and provides additional fields for account details which are needed only in some 27 : * cases. 28 : */ 29 : public class AccountDetailInfo extends AccountInfo { 30 : /** The timestamp of when the account was registered. */ 31 : // TODO(issue-15508): Migrate timestamp fields in *Info/*Input classes from type Timestamp to 32 : // Instant 33 : public Timestamp registeredOn; 34 : 35 : public AccountDetailInfo(Integer id) { 36 5 : super(id); 37 5 : } 38 : 39 : // TODO(issue-15508): Migrate timestamp fields in *Info/*Input classes from type Timestamp to 40 : // Instant 41 : @SuppressWarnings("JdkObsolete") 42 : public void setRegisteredOn(Instant registeredOn) { 43 5 : this.registeredOn = Timestamp.from(registeredOn); 44 5 : } 45 : }