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

org.raml.builder.FacetBuilder Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
package org.raml.builder;

import org.raml.yagi.framework.nodes.KeyValueNode;

/**
 * Created. There, you have it.
 */
public class FacetBuilder extends KeyValueNodeBuilder {

    private ValueNodeFactory value;

    public FacetBuilder(String name) {
        super(name);
    }

    public static FacetBuilder facet(String name) {

        return new FacetBuilder(name);
    }

    public FacetBuilder ofType(String typeName) {

        this.value = ValueNodeFactories.create(typeName);
        return this;
    }

    @Override
    public KeyValueNode buildNode() {
        KeyValueNode node = super.buildNode();
        node.setValue(value.createNode());
        return node;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy