本文整理汇总了Java中jetbrains.buildServer.messages.serviceMessages.ServiceMessage.getAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java ServiceMessage.getAttributes方法的具体用法?Java ServiceMessage.getAttributes怎么用?Java ServiceMessage.getAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jetbrains.buildServer.messages.serviceMessages.ServiceMessage
的用法示例。
在下文中一共展示了ServiceMessage.getAttributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFailureLines
import jetbrains.buildServer.messages.serviceMessages.ServiceMessage; //导入方法依赖的package包/类
public static String[] testFailureLines(String line) {
try {
ServiceMessage msg = ServiceMessage.parse(line.trim());
if (msg != null) {
Map<String, String> attributes = msg.getAttributes();
if (attributes.containsKey("message") && attributes.containsKey("details")) {
String state = TestErrorState.buildErrorPresentationText(attributes.get("message"), attributes.get("details"));
if (state != null) {
return state.split("\n");
} else {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
} else {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
} else {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
} catch (ParseException e) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
}
示例2: translate
import jetbrains.buildServer.messages.serviceMessages.ServiceMessage; //导入方法依赖的package包/类
@NotNull
@Override
public List<BuildMessage1> translate(@NotNull SRunningBuild sRunningBuild, @NotNull BuildMessage1 buildMessage1,
@NotNull ServiceMessage serviceMessage)
{
final Map<String, String> messageAttributes = serviceMessage.getAttributes();
if (messageAttributes.isEmpty())
{
LOG.warning("Could not translate service message with empty attributes.");
return Arrays.asList(buildMessage1);
}
dataStoreServices.get(activeDataStoreName)
.saveData(sRunningBuild, new HighlightData(messageAttributes.get("title"),
Arrays.asList(messageAttributes.get("text")),
valueOfOrDefault(messageAttributes.get("level"), Level.class, Level.info),
valueOfOrDefault(messageAttributes.get("block"), Block.class, Block.expanded),
valueOfOrDefault(messageAttributes.get("order"), Order.class, Order.none)));
return Arrays.asList(buildMessage1);
}
示例3: tryParse
import jetbrains.buildServer.messages.serviceMessages.ServiceMessage; //导入方法依赖的package包/类
@Nullable
public static StatisticMessage tryParse(@NotNull final ServiceMessage message) {
if(!MESSAGE_NAME.equalsIgnoreCase(message.getMessageName())) {
return null;
}
return new StatisticMessage(message.getAttributes());
}
示例4: getParserId
import jetbrains.buildServer.messages.serviceMessages.ServiceMessage; //导入方法依赖的package包/类
@NotNull
protected static ParserId getParserId(@NotNull final ServiceMessage message) {
final Map<String, String> attributes = message.getAttributes();
final String argument = message.getArgument();
final String file = attributes.get("file");
final String name = attributes.get("name");
final String resource = attributes.get("resource");
final String id = attributes.get("id");
if (isEmptyOrSpaces(argument) && isEmptyOrSpaces(file) && isEmptyOrSpaces(name) && isEmptyOrSpaces(resource) && isEmptyOrSpaces(id)) {
throw new IllegalArgumentException("Command requires either attribute 'name', 'file', 'id' or single argument. Actual message: " + message);
}
// TODO: improve
return new ParserId(name, resource, file);
}