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

com.enonic.xp.repository.IndexMapping Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.repository;

import java.net.URL;

import com.fasterxml.jackson.databind.JsonNode;

import com.enonic.xp.annotation.PublicApi;
import com.enonic.xp.data.PropertyTree;
import com.enonic.xp.util.JsonHelper;

@PublicApi
public class IndexMapping
{
    private final JsonNode jsonNode;

    public static IndexMapping from( final PropertyTree propertyTree )
    {
        return new IndexMapping( JsonHelper.from( propertyTree ) );
    }

    public static IndexMapping from( final URL url )
    {
        return new IndexMapping( JsonHelper.from( url ) );
    }

    public static IndexMapping from( final String string )
    {
        return new IndexMapping( JsonHelper.from( string ) );
    }

    public IndexMapping( final JsonNode resourceNode )
    {
        this.jsonNode = resourceNode;
    }

    public JsonNode getNode()
    {
        return jsonNode;
    }

    public String getAsString()
    {
        return this.jsonNode.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy