@Override public List<Element> getElement(final LoadRunnerVUVisitor visitor, final MethodCall method, final MethodcallContext ctx) { if (method == null) { return Collections.emptyList(); } if (method.getParameters() == null || method.getParameters().isEmpty()) { visitor.readSupportedFunctionWithWarn(method.getName(), ctx, method.getName() + " must have a parameter."); return Collections.emptyList(); } visitor.readSupportedFunction(method.getName(), ctx); final String firstParameter = method.getParameters().get(0); final String transactionName = MethodUtils.normalizeName(firstParameter); final ImmutableContainer.Builder currentContainer = ImmutableContainer.builder().name(transactionName); visitor.getCurrentContainers().add(currentContainer); return Collections.emptyList(); } }
/** * @param json A JSON-bindable data structure * @return An immutable value type * @deprecated Do not use this method directly, it exists only for the <em>Jackson</em>-binding infrastructure */ @Deprecated @JsonCreator(mode = JsonCreator.Mode.DELEGATING) static ImmutableContainer fromJson(Json json) { ImmutableContainer.Builder builder = ImmutableContainer.builder(); if (json.childs != null) { builder.addAllChilds(json.childs); } if (json.isSharedIsSet) { builder.isShared(json.isShared); } if (json.name != null) { builder.name(json.name); } if (json.description != null) { builder.description(json.description); } return builder.build(); }
private void from(Object object) { if (object instanceof ShareableElement) { ShareableElement instance = (ShareableElement) object; isShared(instance.isShared()); } if (object instanceof IContainer) { IContainer instance = (IContainer) object; addAllChilds(instance.getChilds()); } if (object instanceof Element) { Element instance = (Element) object; name(instance.getName()); Optional<String> descriptionOptional = instance.getDescription(); if (descriptionOptional.isPresent()) { description(descriptionOptional); } } }