本文整理汇总了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();
}
}
示例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;
}
示例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;
}
示例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;
}