Class Account.Id
- java.lang.Object
-
- com.google.gwtorm.client.IntKey<com.google.gwtorm.client.Key<?>>
-
- com.google.gerrit.reviewdb.client.Account.Id
-
- All Implemented Interfaces:
com.google.gwtorm.client.Key<com.google.gwtorm.client.Key<?>>
,Serializable
- Enclosing class:
- Account
public static class Account.Id extends com.google.gwtorm.client.IntKey<com.google.gwtorm.client.Key<?>>
Key local to Gerrit to identify a user.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
id
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
protected void
set(int newValue)
static Optional<Account.Id>
tryParse(String str)
Parse an Account.Id out of a string representation.
-
-
-
Method Detail
-
get
public int get()
- Specified by:
get
in classcom.google.gwtorm.client.IntKey<com.google.gwtorm.client.Key<?>>
-
set
protected void set(int newValue)
- Specified by:
set
in classcom.google.gwtorm.client.IntKey<com.google.gwtorm.client.Key<?>>
-
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.
-
-