
com.hc360.hcpay.payment.sign.SignVerifyFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of payment-util Show documentation
Show all versions of payment-util Show documentation
hcpay payment-util java sdk
The newest version!
/**
* Copyright(c) 2000-2013 HC360.COM, All Rights Reserved.
* Project: hfb-paydemo
* Author: chenlf
* Createdate: 2:12:36 PM
* Version: 1.0
*
*/
package com.hc360.hcpay.payment.sign;
import java.util.HashMap;
import java.util.Map;
/**
* ??Կ????
* @project hfb-paydemo
* @author chenlf
* @version 1.0
* @date Jan 21, 2015 2:12:36 PM
*/
public class SignVerifyFactory {
private static Map map = new HashMap();
public static SignAndVerify createSignAndVerify(SignType signType){
SignAndVerify signAndVerify = map.get(signType);
if(signAndVerify == null){
synchronized(SignVerifyFactory.class) {
signAndVerify = map.get(signType);
if(signAndVerify == null){
if(SignType.MD5 == signType){
signAndVerify = new MD5();
} else {
throw new RuntimeException(signType.name() + "ǩ????ʽ??֧??");
}
map.put(signType, signAndVerify);
}
}
}
return signAndVerify;
}
}