Package com.google.gerrit.entities
Class Account.Id
- java.lang.Object
-
- com.google.gerrit.entities.Account.Id
-
- All Implemented Interfaces:
Comparable<Account.Id>
- Enclosing class:
- Account
public abstract static class Account.Id extends Object implements Comparable<Account.Id>
Key local to Gerrit to identify a user.
-
-
Constructor Summary
Constructors Constructor Description Id()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Account.Id o)
static Account.Id
fromRef(String name)
static Account.Id
fromRefPart(String name)
Parse an Account.Id out of a part of a ref-name.static Account.Id
fromRefSuffix(String name)
Parse an Account.Id out of the last part of a ref name.int
get()
static Account.Id
parseAfterShardedRefPart(String name)
String
toString()
static Optional<Account.Id>
tryParse(String str)
Parse an Account.Id out of a string representation.
-
-
-
Method Detail
-
tryParse
public static Optional<Account.Id> tryParse(String str)
Parse an Account.Id out of a string representation.
-
fromRef
public static Account.Id fromRef(String name)
-
fromRefPart
public static Account.Id fromRefPart(String name)
Parse an Account.Id out of a part of a ref-name.- Parameters:
name
- a ref name with the following syntax:"34/1234..."
. We assume that the caller has trimmed any prefix.
-
parseAfterShardedRefPart
public static Account.Id parseAfterShardedRefPart(String name)
-
fromRefSuffix
public static Account.Id fromRefSuffix(String name)
Parse an Account.Id out of the last part of a ref name.The input is a ref name of the form
".../1234"
, where the suffix is a non-sharded account ID. Ref names using a sharded ID should usefromRefPart(String)
instead for greater safety.- Parameters:
name
- ref name- Returns:
- account ID, or null if not numeric.
-
get
public int get()
-
compareTo
public final int compareTo(Account.Id o)
- Specified by:
compareTo
in interfaceComparable<Account.Id>
-
-