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

com.weavechain.core.data.IdPolicies Maven / Gradle / Ivy

There is a newer version: 1.3
Show newest version
package com.weavechain.core.data;

import java.util.HashMap;
import java.util.Map;

public class IdPolicies {

    private static final Map policies = new HashMap<>();

    static {
        policies.put("local", LocalIdPolicy.INSTANCE);
        policies.put("localOverwrite", LocalOverwriteIdPolicy.INSTANCE);
    }

    public static IdPolicy getIdPolicy(String policy) {
        IdPolicy idPolicy = policy != null ? policies.get(policy) : null;
        return idPolicy != null ? idPolicy : LocalIdPolicy.INSTANCE;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy