Examples of fieldForId()


Examples of org.apache.thrift.TBase.fieldForId()

        if ( result.hasException() ) {
            Throwable throwable = result.getException();
            int index = 1;
            boolean found = false;
            while ( true ) {
                TFieldIdEnum fieldIdEnum = resultObj.fieldForId( index++ );
                if ( fieldIdEnum == null ) { break; }
                String fieldName = fieldIdEnum.getFieldName();
                String getMethodName = ThriftUtils.generateGetMethodName( fieldName );
                String setMethodName = ThriftUtils.generateSetMethodName( fieldName );
                Method getMethod;
View Full Code Here

Examples of org.apache.thrift.TBase.fieldForId()

            }

        } else {
            Object realResult = result.getResult();
            // result field id is 0
            String fieldName = resultObj.fieldForId( 0 ).getFieldName();
            String setMethodName = ThriftUtils.generateSetMethodName( fieldName );
            String getMethodName = ThriftUtils.generateGetMethodName( fieldName );
            Method getMethod;
            Method setMethod;
            try {
View Full Code Here

Examples of thrift.test.OneOfEachBeans.fieldForId()

      throw new RuntimeException("isSet method error: unset field returned as set!");
    if (ooe.is_set_some_characters())
      throw new RuntimeException("isSet method error: unset field returned as set!");

    for (int i = 1; i < 12; i++){
      if (ooe.isSet(ooe.fieldForId(i)))
        throw new RuntimeException("isSet method error: unset field " + i + " returned as set!");
    }

    // Everything is set
    ooe.set_a_bite((byte) 1);
View Full Code Here

Examples of thrift.test.OneOfEachBeans.fieldForId()

      throw new RuntimeException("isSet method error: set field returned as unset!");
    if (!ooe.is_set_some_characters())
      throw new RuntimeException("isSet method error: set field returned as unset!");

    for (int i = 1; i < 12; i++){
      if (!ooe.isSet(ooe.fieldForId(i)))
        throw new RuntimeException("isSet method error: set field " + i + " returned as unset!");
    }

    // Should throw exception when field doesn't exist
    boolean exceptionThrown = false;
View Full Code Here

Examples of thrift.test.OneOfEachBeans.fieldForId()

    }

    // Should throw exception when field doesn't exist
    boolean exceptionThrown = false;
    try{
      if (ooe.isSet(ooe.fieldForId(100)));
    } catch (IllegalArgumentException e){
      exceptionThrown = true;
    }
    if (!exceptionThrown)
      throw new RuntimeException("isSet method error: non-existent field provided as agument but no exception thrown!");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.