public final class StringUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PLUGIN_IMAGES_URL
The base URL of the plugin images.
|
static String |
PLUGIN_JS_URL
The base URL of the plugin javascripts.
|
static String |
PLUGIN_URL
The base URL of this plugin.
|
static String |
REFSPEC_PREFIX
What comes before the change and patch numbers in a refspec.
|
Modifier and Type | Method and Description |
---|---|
static String |
escapeQuotes(String value)
Escape quotes in String value.
|
static String |
getDefaultDisplayNameForSpecificServer(com.sonymobile.tools.gerrit.gerritevents.GerritEventListener listener,
String serverName)
Helper method for
NamedGerritEventListener s. |
static String |
getPluginImageUrl(String imageName)
Gets the path to the provided image inside this plugin.
|
static String |
getPluginJsUrl(String jsName)
Gets the path to the provided javascript file inside this plugin.
|
static String |
makeRefSpec(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event)
Creates a refspec string from the data in the event.
|
public static final String REFSPEC_PREFIX
public static final String PLUGIN_URL
public static final String PLUGIN_IMAGES_URL
public static final String PLUGIN_JS_URL
public static String makeRefSpec(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event)
event
- the event.ChangeBasedEvent.getPatchSet()
,
PatchSet.getRef()
public static String getPluginImageUrl(String imageName)
Action.getIconFileName()
expects.imageName
- the fileName of the image.PLUGIN_IMAGES_URL
public static String getPluginJsUrl(String jsName)
jsName
- the name if the javascript.PLUGIN_JS_URL
public static String escapeQuotes(String value)
value
- the name of String object having quotes.public static String getDefaultDisplayNameForSpecificServer(com.sonymobile.tools.gerrit.gerritevents.GerritEventListener listener, String serverName)
NamedGerritEventListener
s.
To display a consistent "Server: Simple Name" pattern.
Usable by Diagnostics
.listener
- the listener to get the class name fromserverName
- the name of the server to get the server's display name from,
null or empty string produces "Any Server"Copyright © 2016–2019. All rights reserved.