class GafferResultCacheUtil {

    public static Graph createGraph(final String graphId, final String cacheStorePropertiesPath, final Long timeToLive) {
        if (null == cacheStorePropertiesPath) {
            throw new IllegalArgumentException("Gaffer result cache Store properties are required");
        }

        final Graph.Builder graphBuilder = new Graph.Builder()
                .config(new GraphConfig.Builder()
                        .graphId(graphId)
                        .build())
                .storeProperties(cacheStorePropertiesPath)
                .addSchema(createSchema(timeToLive));

        final Graph graph = graphBuilder.build();
        if (!graph.hasTrait(StoreTrait.STORE_VALIDATION)) {
            LOGGER.warn("Gaffer JSON export graph does not have {} trait so results may not be aged off.", StoreTrait.STORE_VALIDATION.name());
        }

        return graph;
    }

    private  GafferResultCacheUtil();

}