@ThreadSafe public class ThriftMethodProcessorCustom extends com.facebook.swift.service.ThriftMethodProcessor
ThriftMethodProcessor,收到的primitive封装类型(Boolean,Integer...)如果是null不会被转成default 0.
通过调用 setUseDefaultValueIfPrimitiveWrap(boolean) 方法设置为true可以禁用该特性| Constructor and Description |
|---|
ThriftMethodProcessorCustom(java.lang.Object service,
java.lang.String serviceName,
com.facebook.swift.service.metadata.ThriftMethodMetadata methodMetadata,
com.facebook.swift.codec.ThriftCodecManager codecManager) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName() |
java.lang.String |
getQualifiedName() |
java.lang.Class<?> |
getServiceClass() |
java.lang.String |
getServiceName() |
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
process(org.apache.thrift.protocol.TProtocol in,
org.apache.thrift.protocol.TProtocol out,
int sequenceId,
com.facebook.swift.service.ContextChain contextChain) |
static void |
setUseDefaultValueIfPrimitiveWrap(boolean useDefaultValueIfPrimitiveWrap)
设置对于primitive wrap类型是否将
null转为default value,默认为false 该方法只能被调用一次 |
public ThriftMethodProcessorCustom(java.lang.Object service, java.lang.String serviceName, com.facebook.swift.service.metadata.ThriftMethodMetadata methodMetadata, com.facebook.swift.codec.ThriftCodecManager codecManager)
public java.lang.String getName()
getName in class com.facebook.swift.service.ThriftMethodProcessorpublic java.lang.Class<?> getServiceClass()
getServiceClass in class com.facebook.swift.service.ThriftMethodProcessorpublic java.lang.String getServiceName()
getServiceName in class com.facebook.swift.service.ThriftMethodProcessorpublic java.lang.String getQualifiedName()
getQualifiedName in class com.facebook.swift.service.ThriftMethodProcessorpublic com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> process(org.apache.thrift.protocol.TProtocol in, org.apache.thrift.protocol.TProtocol out, int sequenceId, com.facebook.swift.service.ContextChain contextChain) throws java.lang.Exception
process in class com.facebook.swift.service.ThriftMethodProcessorjava.lang.Exceptionpublic static void setUseDefaultValueIfPrimitiveWrap(boolean useDefaultValueIfPrimitiveWrap)
null转为default value,默认为false useDefaultValueIfPrimitiveWrap - java.lang.IllegalStateException - 该方法已经被调用过Copyright © 2019. All rights reserved.