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

pro.jk.ejoker.common.utils.relationship.AbstractRelationshipUtil Maven / Gradle / Ivy

There is a newer version: 3.0.7.1
Show newest version
package pro.jk.ejoker.common.utils.relationship;

public abstract class AbstractRelationshipUtil {

//	protected ThreadLocal> taskQueueBox = ThreadLocal.withInitial(LinkedBlockingQueue::new);

	protected final SpecialTypeCodecStore specialTypeCodecStore;
	
	protected AbstractRelationshipUtil(SpecialTypeCodecStore specialTypeCodecStore) {
		this.specialTypeCodecStore = specialTypeCodecStore;
	}
	
	protected Object processWithUserSpecialCodec(Object value, Class fieldType) {
		if(null == specialTypeCodecStore)
			return null;
		
		SpecialTypeCodec fieldTypeCodec = specialTypeCodecStore.getCodec(fieldType);
		if(null == fieldTypeCodec)
			return null;
		
		/// 完全类型对等
		if(fieldType.equals(value.getClass()))
			return fieldTypeCodec.encode(value);
		
		return null;
	}
	
	protected SpecialTypeCodec getDeserializeCodec(Class fieldType) {
		if(null == specialTypeCodecStore)
			return null;
		
		return specialTypeCodecStore.getCodec(fieldType);
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy