final ImmutableProject.Builder projectBuilder, final ImmutableUserPath.Builder userPathBuilder) { final ImmutableContainerForMulti.Builder initContainerBuilder = ImmutableContainerForMulti.builder().name(NAME_INIT).tag(TAG_INIT); projectFileReader.getInits().stream().map(containersByName::get).filter(Objects::nonNull).forEach(initContainerBuilder::addChilds); final ImmutableContainerForMulti.Builder actionsContainerBuilder = ImmutableContainerForMulti.builder().name(NAME_ACTIONS).tag(TAG_ACTIONS); if (projectFileReader.getActions().isEmpty()) { containersByName.values().stream() final ImmutableContainerForMulti.Builder endContainerBuilder = ImmutableContainerForMulti.builder().name(NAME_END).tag(TAG_END); projectFileReader.getEnds().stream().map(containersByName::get).filter(Objects::nonNull).forEach(endContainerBuilder::addChilds); userPathBuilder.initContainer(ImmutableContainerForMulti.builder().name(NAME_INIT).tag(TAG_INIT).addAllChilds(childContainer.getChilds()).build()); } else{ userPathBuilder.initContainer(init); userPathBuilder.actionsContainer(ImmutableContainerForMulti.builder().name(NAME_ACTIONS).tag(TAG_ACTIONS).addAllChilds(childContainer.getChilds()).build()); } else{ userPathBuilder.actionsContainer(actions); userPathBuilder.endContainer(ImmutableContainerForMulti.builder().name(NAME_END).tag(TAG_END).addAllChilds(childContainer.getChilds()).build()); } else{ userPathBuilder.endContainer(end);
private ContainerForMulti readElse(SelectionstatementContext selectionstatementContext) { final List<Element> elseElements = new ArrayList<>(); final ImmutableContainerForMulti.Builder builder = ImmutableContainerForMulti.builder().name(NAME_ELSE).tag(TAG_ELSE); if(selectionstatementContext.getChildCount() > 6){ elseElements.addAll(selectionstatementContext.getChild(6).accept(new StatementContextVisitor(visitor, builder))); } return builder.build(); }
/** * @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 ImmutableContainerForMulti fromJson(Json json) { ImmutableContainerForMulti.Builder builder = ImmutableContainerForMulti.builder(); if (json.tag != null) { builder.tag(json.tag); } 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); } } if (object instanceof ContainerForMulti) { ContainerForMulti instance = (ContainerForMulti) object; tag(instance.getTag()); } }
private ContainerForMulti readThen(SelectionstatementContext selectionstatementContext) { final ImmutableContainerForMulti.Builder builder = ImmutableContainerForMulti.builder().name(NAME_THEN).tag(TAG_THEN); selectionstatementContext.getChild(4).accept(new StatementContextVisitor(visitor, builder)); return builder.build(); }