ai.stapi.graphoperations.graphLanguage.graphDescription.graphDescriptionBuilder.specificDescriptionBuilders.positive.MarkdownAttributeValueDescriptionBuilder Maven / Gradle / Ivy
package ai.stapi.graphoperations.graphLanguage.graphDescription.graphDescriptionBuilder.specificDescriptionBuilders.positive;
import ai.stapi.graph.attribute.attributeValue.MarkdownAttributeValue;
import ai.stapi.graphoperations.graphLanguage.graphDescription.GraphDescription;
import ai.stapi.graphoperations.graphLanguage.graphDescription.graphDescriptionBuilder.specificDescriptionBuilders.SpecificGraphDescriptionBuilder;
import ai.stapi.graphoperations.graphLanguage.graphDescription.specific.positive.MarkdownAttributeValueDescription;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class MarkdownAttributeValueDescriptionBuilder
extends AbstractAttributeValueDescriptionBuilder {
@Override
protected MarkdownAttributeValueDescription buildAttributeDescription(
List children
) {
return new MarkdownAttributeValueDescription(children);
}
@Override
public boolean represents(GraphDescription graphDescription) {
return graphDescription instanceof MarkdownAttributeValueDescription;
}
@Override
public String getSupportedDataTypeId() {
return MarkdownAttributeValue.SERIALIZATION_TYPE;
}
@Override
public MarkdownAttributeValueDescription copyWithNewChildren(
GraphDescription graphDescription,
List newChildren
) {
return new MarkdownAttributeValueDescription(newChildren);
}
@Override
public MarkdownAttributeValueDescriptionBuilder getCopy() {
var builder = new MarkdownAttributeValueDescriptionBuilder();
builder.setChildren(this.getChildren().stream()
.map(SpecificGraphDescriptionBuilder::getCopy)
.collect(Collectors.toCollection(ArrayList::new)));
return builder;
}
}