LCOV - code coverage report
Current view: top level - server/account - AuthResult.java (source / functions) Hit Total Coverage
Test: _coverage_report.dat Lines: 8 8 100.0 %
Date: 2022-11-19 15:00:39 Functions: 4 4 100.0 %

          Line data    Source code
       1             : // Copyright (C) 2009 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.account;
      16             : 
      17             : import com.google.gerrit.entities.Account;
      18             : import com.google.gerrit.server.account.externalids.ExternalId;
      19             : 
      20             : /** Result from {@link AccountManager#authenticate(AuthRequest)}. */
      21             : public class AuthResult {
      22             :   private final Account.Id accountId;
      23             :   private final ExternalId.Key externalId;
      24             :   private final boolean isNew;
      25             : 
      26          19 :   public AuthResult(Account.Id accountId, ExternalId.Key externalId, boolean isNew) {
      27          19 :     this.accountId = accountId;
      28          19 :     this.externalId = externalId;
      29          19 :     this.isNew = isNew;
      30          19 :   }
      31             : 
      32             :   /** Identity of the user account that was authenticated into. */
      33             :   public Account.Id getAccountId() {
      34          16 :     return accountId;
      35             :   }
      36             : 
      37             :   /** External identity used to authenticate the user. */
      38             :   public ExternalId.Key getExternalId() {
      39           2 :     return externalId;
      40             :   }
      41             : 
      42             :   /**
      43             :    * True if this account was recently created for the user.
      44             :    *
      45             :    * <p>New users should be redirected to the registration screen, so they can configure their new
      46             :    * user account.
      47             :    */
      48             :   public boolean isNew() {
      49           1 :     return isNew;
      50             :   }
      51             : }

Generated by: LCOV version 1.16+git.20220603.dfeb750