本文整理汇总了Java中com.microsoft.tfs.core.clients.workitem.fields.FieldCollection类的典型用法代码示例。如果您正苦于以下问题:Java FieldCollection类的具体用法?Java FieldCollection怎么用?Java FieldCollection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FieldCollection类属于com.microsoft.tfs.core.clients.workitem.fields包,在下文中一共展示了FieldCollection类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSubstitutionValue
import com.microsoft.tfs.core.clients.workitem.fields.FieldCollection; //导入依赖的package包/类
/**
* Get the substitution value for the specified value. The value represents
* the name of a WIT field. A new substitution value must be generated on
* each call of the method since the value may depend on the current value
* of a WIT field.
*/
@Override
public String getSubstitutionValue(final WorkItem workItem) {
// Locate the WIT field specified by the "Value" attribute.
final FieldCollection fields = workItem.getFields();
final Field field = fields.getField(parameterValue);
if (field != null) {
if (getType() == WIFormParamTypeEnum.ORIGINAL) {
// Use the original value of the WIT field.
final Object originalValue = field.getOriginalValue();
if (originalValue != null) {
return originalValue.toString();
}
} else {
// Use the current value of the WIT field.
final Object currentValue = field.getValue();
if (currentValue != null) {
return currentValue.toString();
}
}
}
return ""; //$NON-NLS-1$
}
示例2: convertWorkItemToIssueData
import com.microsoft.tfs.core.clients.workitem.fields.FieldCollection; //导入依赖的package包/类
/**
* Converts a TFS work item into JetBrains standard IssueData object.
* @param workItem The work item to convert.
* @param hyperlinkBuilder The hyperlink builder needed to create links.
* @return The converted IssueData item.
*/
@NotNull
private static IssueData convertWorkItemToIssueData(@NotNull WorkItem workItem, @NotNull TSWAHyperlinkBuilder hyperlinkBuilder) {
Map<String, String> data = new HashMap<String, String>();
data.put(IssueData.SUMMARY_FIELD, workItem.getTitle());
final FieldCollection fields = workItem.getFields();
// Determine state to see if done
String value = fields.getField(CoreFieldReferenceNames.STATE).getValue().toString();
boolean resolved = !workItem.isOpen();
data.put(IssueData.STATE_FIELD, value);
// Get feature request state
String issueType = fields.getField(CoreFieldReferenceNames.WORK_ITEM_TYPE).getValue().toString();
boolean featureRequest = !issueType.equalsIgnoreCase("task");
data.put(IssueData.TYPE_FIELD, issueType);
return new IssueData(
Integer.toString(workItem.getID()),
data,
resolved,
featureRequest,
hyperlinkBuilder.getWorkItemEditorURL(workItem.getID()).toString());
}
示例3: getStringValue
import com.microsoft.tfs.core.clients.workitem.fields.FieldCollection; //导入依赖的package包/类
@NotNull
private static String getStringValue(@NotNull com.microsoft.tfs.core.clients.workitem.WorkItem workItem, @NotNull WorkItemField field) {
FieldCollection fields = workItem.getFields();
String result = null;
if (fields.contains(field.getSerialized())) {
result = (String)fields.getField(field.getSerialized()).getValue();
}
return StringUtil.notNullize(result);
}
示例4: getFields
import com.microsoft.tfs.core.clients.workitem.fields.FieldCollection; //导入依赖的package包/类
@Override
public FieldCollection getFields() {
return fieldCollection;
}
示例5: getFields
import com.microsoft.tfs.core.clients.workitem.fields.FieldCollection; //导入依赖的package包/类
/**
* @return the FieldCollection object that contains the Fields of this work
* item.
*/
public FieldCollection getFields();