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
Key local to Gerrit to identify a user.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int
static Account.Id
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
final String
toString()
static Optional<Account.Id>
Parse an Account.Id out of a string representation.
-
Constructor Details
-
Id
public Id()
-
-
Method Details
-
tryParse
Parse an Account.Id out of a string representation. -
fromRef
-
fromRefPart
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
-
fromRefSuffix
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
- Specified by:
compareTo
in interfaceComparable<Account.Id>
-
toString
-