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

com.zhibaocloud.carbon.intg.jackson.desensitization.CarbonDesensitizationFactory Maven / Gradle / Ivy

The newest version!
package com.zhibaocloud.carbon.intg.jackson.desensitization;


import com.zhibaocloud.carbon.intg.desensitization.CarbonDesensitization;
import java.util.HashMap;
import java.util.Map;

/**
 * @author yangtuo
 */
public class CarbonDesensitizationFactory {

  private CarbonDesensitizationFactory() {
  }

  private static final Map>, CarbonDesensitization> map = new HashMap<>();

  @SuppressWarnings("all")
  public static CarbonDesensitization getDesensitization(
      Class> clazz) {
    return map.computeIfAbsent(clazz, k -> {
      try {
        return (CarbonDesensitization) k.newInstance();
      } catch (InstantiationException | IllegalAccessException e) {
        throw new UnsupportedOperationException(e.getMessage(), e);
      }
    });
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy