當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。