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

com.github.zthulj.zcopybook.factory.NodeFactory Maven / Gradle / Ivy

Go to download

Library helping to convert positionnal inputs (cobol) to json, using a copybook format

The newest version!
package com.github.zthulj.zcopybook.factory;

import com.github.zthulj.zcopybook.model.*;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.LinkedHashMap;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class NodeFactory {

    public static  RootNode createRootNode() {
        return new RootNode<>(new LinkedHashMap());
    }

    public static  ParentNode createParentNode(ParentNode parent, int lvlNumber) {
        return new ParentNode<>(parent, new LinkedHashMap<>(), lvlNumber);
    }

    public static  ValueNode createValueNode(ParentNode parent, Coordinates coords) {
        return createValueNode(parent, coords, ValueNode.ValueType.STRING);
    }

    public static   ValueNode createValueNode(ParentNode parent, Coordinates coords, ValueNode.ValueType type) {
        return new ValueNode(parent, coords, type);
    }

    public static  ParentArrayNode createParentNodeArray(ParentNode parent, int lvlNumber, int occursNumber) {
        return new ParentArrayNode(parent, lvlNumber, occursNumber);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy