Package com.google.gerrit.server.util
Class AccountTemplateUtil
- java.lang.Object
-
- com.google.gerrit.server.util.AccountTemplateUtil
-
public class AccountTemplateUtil extends Object
Utility functions for text that can be persisted in data storage and should not contain user identifiable information, e.g.ChangeMessage
orAttentionSetUpdate.reason()
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACCOUNT_TEMPLATE
Template to represent account in pseudonymized form in text, that might be persisted in data storage.static Pattern
ACCOUNT_TEMPLATE_PATTERN
static String
ACCOUNT_TEMPLATE_REGEX
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
getAccountTemplate(Account.Id accountId)
static com.google.common.collect.ImmutableSet<Account.Id>
parseTemplates(String textTemplate)
Returns account ids that are used in text, that might containACCOUNT_TEMPLATE
.String
replaceTemplates(String messageTemplate)
Builds user-readable text from text, that might containACCOUNT_TEMPLATE
.
-
-
-
Field Detail
-
ACCOUNT_TEMPLATE
public static final String ACCOUNT_TEMPLATE
Template to represent account in pseudonymized form in text, that might be persisted in data storage.- See Also:
- Constant Field Values
-
ACCOUNT_TEMPLATE_REGEX
public static final String ACCOUNT_TEMPLATE_REGEX
- See Also:
- Constant Field Values
-
ACCOUNT_TEMPLATE_PATTERN
public static final Pattern ACCOUNT_TEMPLATE_PATTERN
-
-
Method Detail
-
parseTemplates
public static com.google.common.collect.ImmutableSet<Account.Id> parseTemplates(String textTemplate)
Returns account ids that are used in text, that might containACCOUNT_TEMPLATE
.
-
getAccountTemplate
public static String getAccountTemplate(Account.Id accountId)
-
replaceTemplates
public String replaceTemplates(String messageTemplate)
Builds user-readable text from text, that might containACCOUNT_TEMPLATE
.
-
-