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

io.legaldocml.xpath.cerebro.CerebroDefinition Maven / Gradle / Ivy

package io.legaldocml.xpath.cerebro;

import com.google.common.collect.ImmutableMap;
import io.legaldocml.akn.AknObject;

public final class CerebroDefinition {

    private final ImmutableMap, CerebroLink> links;

    public CerebroDefinition(CerebroLink... cerebroLinks) {
        this(null, cerebroLinks);
    }
    public CerebroDefinition(CerebroDefinition parent, CerebroLink... cerebroLinks) {
        ImmutableMap.Builder builder =  ImmutableMap., CerebroLink>builder();

        if (parent != null) {
            builder.putAll(parent.links);
        }

        for (CerebroLink link : cerebroLinks) {
            builder.put(link.getAknClass(), link);
        }
        this.links = builder.build();
    }

    public CerebroLink getLink(Class child) {
        return  links.get(child);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy