org.apache.thrift.scheme.TupleScheme Java Examples
The following examples show how to use
org.apache.thrift.scheme.TupleScheme.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MockResult.java From thrift-mock with Apache License 2.0 | 6 votes |
public MockResult(String methodName, TBase value) { this.methodName = methodName; this.success = value; this.structDesc = new TStruct(methodName+"_result"); //init metaDatMap Map<_Fields, FieldMetaData> tmpMap = new EnumMap<>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData(SUCCESS_NAME, TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT , value.getClass().getCanonicalName()))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(MockResult.class, metaDataMap); schemes.put(StandardScheme.class, new MockResultStandardSchemeFactory(structDesc)); schemes.put(TupleScheme.class, new MockResultTupleSchemeFactory()); }