当前位置: 首页>>代码示例>>Java>>正文


Java FieldCollection类代码示例

本文整理汇总了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$
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:31,代码来源:WIFormParamImpl.java

示例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());
}
 
开发者ID:dpiessens,项目名称:tfs-worktiem-plugin,代码行数:32,代码来源:TfsJavaDataProvider.java

示例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);
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:12,代码来源:WorkItem.java

示例4: getFields

import com.microsoft.tfs.core.clients.workitem.fields.FieldCollection; //导入依赖的package包/类
@Override
public FieldCollection getFields() {
    return fieldCollection;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:5,代码来源:WorkItemImpl.java

示例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();
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:6,代码来源:WorkItem.java


注:本文中的com.microsoft.tfs.core.clients.workitem.fields.FieldCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。