public Metadata convert(TTags node) { if (Objects.isNull(node)) return null; return node.getTag().stream() .filter(Objects::nonNull) .collect(Collectors.toMap( TTag::getName, TTag::getValue, (a, b) -> a + "|" + b, Metadata::new)); }
public Builder addTags(List<TTag> tags) { if (tags == null) { return this; } TTags tmp = new TTags(); tmp.getTag().addAll(tags); return addTags(tmp); }
public Builder addTags(TTag tags) { if (tags == null) { return this; } TTags tmp = new TTags(); tmp.getTag().add(tags); return addTags(tmp); }
public T addTags(TTag tags) { if (tags == null) { return self(); } TTags tmp = new TTags(); tmp.getTag().add(tags); return addTags(tmp); }
public T addTags(List<TTag> tags) { if (tags == null) { return self(); } TTags tmp = new TTags(); tmp.getTag().addAll(tags); return addTags(tmp); }
public T addTags(List<TTag> tags) { if (tags == null) { return self(); } TTags tmp = new TTags(); tmp.getTag().addAll(tags); return addTags(tmp); }
public T addTags(TTag tags) { if (tags == null) { return self(); } TTags tmp = new TTags(); tmp.getTag().add(tags); return addTags(tmp); }
public static String getTagValue(TServiceTemplate serviceTemplate, String tagKey) { if (serviceTemplate.getTags() != null) { for (TTag tag : serviceTemplate.getTags().getTag()) { if (tag.getName().equals(tagKey)) { return tag.getValue(); } } } return null; }
int check = 0; QName artifactType = null; for (TTag tag : stRes.getServiceTemplate().getTags().getTag()) { switch (tag.getName()) { case "xaasPackageNode":
private Collection<ServiceTemplateId> getXaaSPackageTemplates() { Collection<AbstractComponentInstanceResource> templates = this.getAll(); Collection<ServiceTemplateId> xaasPackages = new ArrayList<ServiceTemplateId>(); for (AbstractComponentInstanceResource resource : templates) { if (resource instanceof ServiceTemplateResource) { ServiceTemplateResource stRes = (ServiceTemplateResource) resource; TTags tags = stRes.getServiceTemplate().getTags(); if (tags == null) { continue; } int check = 0; for (TTag tag : tags.getTag()) { switch (tag.getName()) { case "xaasPackageNode": case "xaasPackageArtifactType": case "xaasPackageDeploymentArtifact": check++; break; default: break; } } if (check == 3) { xaasPackages.add((ServiceTemplateId) stRes.getId()); } } } return xaasPackages; }
public void visit(TServiceTemplate serviceTemplate) { Objects.requireNonNull(serviceTemplate); visit((TExtensibleElements) serviceTemplate); final TTopologyTemplate topologyTemplate = serviceTemplate.getTopologyTemplate(); if (topologyTemplate != null) { topologyTemplate.accept(this); } final TTags tags = serviceTemplate.getTags(); if (tags != null) { for (TTag tag : tags.getTag()) { tag.accept(this); } } final TPlans plans = serviceTemplate.getPlans(); if (plans != null) { for (TPlan plan : plans.getPlan()) { plan.accept(this); } } final TBoundaryDefinitions boundaryDefinitions = serviceTemplate.getBoundaryDefinitions(); if (boundaryDefinitions != null) { boundaryDefinitions.accept(this); } }
return new TagsResource(this, tags.getTag());