@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.ThriftMethodProcessor
public java.lang.Class<?> getServiceClass()
getServiceClass
in class com.facebook.swift.service.ThriftMethodProcessor
public java.lang.String getServiceName()
getServiceName
in class com.facebook.swift.service.ThriftMethodProcessor
public java.lang.String getQualifiedName()
getQualifiedName
in class com.facebook.swift.service.ThriftMethodProcessor
public 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.ThriftMethodProcessor
java.lang.Exception
public static void setUseDefaultValueIfPrimitiveWrap(boolean useDefaultValueIfPrimitiveWrap)
null
转为default value,默认为false
useDefaultValueIfPrimitiveWrap
- java.lang.IllegalStateException
- 该方法已经被调用过Copyright © 2019. All rights reserved.