All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.bdeploy.bhive.objects.view.ManifestRefView Maven / Gradle / Ivy

Go to download

Public API including dependencies, ready to be used for integrations and plugins.

The newest version!
package io.bdeploy.bhive.objects.view;

import java.util.Collection;

import io.bdeploy.bhive.model.Manifest;
import io.bdeploy.bhive.model.Manifest.Key;
import io.bdeploy.bhive.model.ObjectId;
import io.bdeploy.bhive.model.Tree;

/**
 * View of a {@link Manifest} reference in a {@link Tree}.
 * 

* A {@link Manifest} reference uses the referenced {@link Manifest}'s root {@link Tree} {@link ObjectId} as * {@link #getElementId() element ID}. Since {@link ManifestRefView} extends {@link TreeView} this means that * {@link ManifestRefView}'s can be visited as {@link TreeView}'s without caring that this is actually a referenced * {@link Manifest}. *

* The {@link ObjectId} of the actual reference in the source {@link Tree} can be obtained using {@link #getReferenceId()} in case * it is required (i.e. collecting all {@link ObjectId}s transitively required by a {@link Tree}). */ public class ManifestRefView extends TreeView { private final Key referenced; private final ObjectId refId; public ManifestRefView(ObjectId refId, Manifest.Key referenced, ObjectId rootTreeId, Collection path) { super(rootTreeId, path); this.referenced = referenced; this.refId = refId; } /** * @return the {@link Key} of the referenced {@link Manifest}. */ public Manifest.Key getReferenced() { return referenced; } /** * @return the {@link ObjectId} of the actual reference in the source {@link Tree}. */ public ObjectId getReferenceId() { return refId; } @Override public String toString() { return getClass().getSimpleName() + "[path:" + getPathString() + ", id:" + getElementId() + ", ref: " + referenced + " {" + refId + "}]"; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy