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


Java Fingerprint.getFacets方法代码示例

本文整理汇总了Java中hudson.model.Fingerprint.getFacets方法的典型用法代码示例。如果您正苦于以下问题:Java Fingerprint.getFacets方法的具体用法?Java Fingerprint.getFacets怎么用?Java Fingerprint.getFacets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hudson.model.Fingerprint的用法示例。


在下文中一共展示了Fingerprint.getFacets方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addRunFacet

import hudson.model.Fingerprint; //导入方法依赖的package包/类
/**
 * Adds a new {@link ContainerRecord} for the specified image, creating necessary intermediate objects as it goes.
 */
public static void addRunFacet(@Nonnull ContainerRecord record, @Nonnull Run<?,?> run) throws IOException {
    String imageId = record.getImageId();
    Fingerprint f = forImage(run, imageId);
    Collection<FingerprintFacet> facets = f.getFacets();
    DockerRunFingerprintFacet runFacet = null;
    for (FingerprintFacet facet : facets) {
        if (facet instanceof DockerRunFingerprintFacet) {
            runFacet = (DockerRunFingerprintFacet) facet;
            break;
        }
    }
    BulkChange bc = new BulkChange(f);
    try {
        if (runFacet == null) {
            runFacet = new DockerRunFingerprintFacet(f, System.currentTimeMillis(), imageId);
            facets.add(runFacet);
        }
        runFacet.add(record);
        runFacet.addFor(run);
        DockerFingerprintAction.addToRun(f, imageId, run);
        bc.commit();
    } finally {
        bc.abort();
    }
}
 
开发者ID:jenkinsci,项目名称:docker-commons-plugin,代码行数:29,代码来源:DockerFingerprints.java

示例2: for

import hudson.model.Fingerprint; //导入方法依赖的package包/类
/**
 * Retrieves a facet from the {@link Fingerprint}.
 * @param <TFacet> Facet type to be retrieved
 * @param fingerprint Fingerprint, which stores facets
 * @param facetClass Class to be retrieved
 * @return First matching facet.
 */
 @SuppressWarnings("unchecked")
public static @CheckForNull <TFacet extends FingerprintFacet> TFacet getFacet
        (@Nonnull Fingerprint fingerprint, @Nonnull Class<TFacet> facetClass) {  
    for ( FingerprintFacet facet : fingerprint.getFacets()) {
        if (facetClass.isAssignableFrom(facet.getClass())) {
            return (TFacet)facet;
        }
    }
    return null;      
}
 
开发者ID:jenkinsci,项目名称:docker-commons-plugin,代码行数:18,代码来源:DockerFingerprints.java

示例3: getDockerFacets

import hudson.model.Fingerprint; //导入方法依赖的package包/类
public List<DockerFingerprintFacet> getDockerFacets(String imageId) {
    List<DockerFingerprintFacet> res = new LinkedList<DockerFingerprintFacet>();
    final Fingerprint fp = getFingerprint(imageId);
    if (fp != null) {
        for (final FingerprintFacet f : fp.getFacets()) {
            if (f instanceof DockerFingerprintFacet) {
                res.add((DockerFingerprintFacet) f);
            }
        }
    }
    return res;
}
 
开发者ID:jenkinsci,项目名称:docker-commons-plugin,代码行数:13,代码来源:DockerFingerprintAction.java

示例4: for

import hudson.model.Fingerprint; //导入方法依赖的package包/类
public static @CheckForNull @SuppressWarnings("unchecked")
        <TFacet extends FingerprintFacet> TFacet getFacet
        (@Nonnull Fingerprint fingerprint, @Nonnull Class<TFacet> facetClass) {  
    for ( FingerprintFacet facet : fingerprint.getFacets()) {
        if (facetClass.isAssignableFrom(facet.getClass())) {
            return (TFacet)facet;
        }
    }
    return null;      
}
 
开发者ID:jenkinsci,项目名称:docker-traceability-plugin,代码行数:11,代码来源:FingerprintsHelper.java


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