private static void mapNumericField(final Object mappingClassInstance,final Field mappingField,final JBBPNumericField numericField,final boolean invertBitOrder){
  final Class<?> fieldClass=mappingField.getType();
  try {
    if (fieldClass == byte.class) {
      mappingField.setByte(mappingClassInstance,(byte)(invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsInt()));
    }
 else     if (fieldClass == boolean.class) {
      mappingField.setBoolean(mappingClassInstance,numericField.getAsBool());
    }
 else     if (fieldClass == char.class) {
      mappingField.setChar(mappingClassInstance,(char)(invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsInt()));
    }
 else     if (fieldClass == short.class) {
      mappingField.setShort(mappingClassInstance,(short)(invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsInt()));
    }
 else     if (fieldClass == int.class) {
      mappingField.setInt(mappingClassInstance,(int)(invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsInt()));
    }
 else     if (fieldClass == long.class) {
      mappingField.setLong(mappingClassInstance,(invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsLong()));
    }
 else     if (fieldClass == float.class) {
      mappingField.setFloat(mappingClassInstance,Float.intBitsToFloat(invertBitOrder ? (int)numericField.getAsInvertedBitOrder() : numericField.getAsInt()));
    }
 else     if (fieldClass == double.class) {
      mappingField.setDouble(mappingClassInstance,Double.longBitsToDouble(invertBitOrder ? numericField.getAsInvertedBitOrder() : numericField.getAsLong()));
    }
 else {
      throw new JBBPMapperException("Unsupported mapping class field type to be mapped for binary parsed data",(JBBPAbstractField)numericField,mappingClassInstance.getClass(),mappingField,null);
    }
  }
 catch (  IllegalAccessException ex) {
    throw new JBBPMapperException("Can't get access to a mapping field",(JBBPAbstractField)numericField,mappingClassInstance.getClass(),mappingField,ex);
  }
catch (  IllegalArgumentException ex) {
    throw new JBBPMapperException("Can't set argument to a mapping field",(JBBPAbstractField)numericField,mappingClassInstance.getClass(),mappingField,ex);
  }
}

private static void mapNumericField ( final Object mappingClassInstance , final Field mappingField , final JBBPNumericField numericField , final boolean invertBitOrder ) { final Class < ? > fieldClass = mappingField . getType ( ) ; try { if ( fieldClass == byte . class ) { mappingField . setByte ( mappingClassInstance , ( byte ) ( invertBitOrder ? numericField . getAsInvertedBitOrder ( ) : numericField . getAsInt ( ) ) ) ; } else if ( fieldClass == boolean . class ) { mappingField . setBoolean ( mappingClassInstance , numericField . getAsBool ( ) ) ; } else if ( fieldClass == char . class ) { mappingField . setChar ( mappingClassInstance , ( char ) ( invertBitOrder ? numericField . getAsInvertedBitOrder ( ) : numericField . getAsInt ( ) ) ) ; } else if ( fieldClass == short . class ) { mappingField . setShort ( mappingClassInstance , ( short ) ( invertBitOrder ? numericField . getAsInvertedBitOrder ( ) : numericField . getAsInt ( ) ) ) ; } else if ( fieldClass == int . class ) { mappingField . setInt ( mappingClassInstance , ( int ) ( invertBitOrder ? numericField . getAsInvertedBitOrder ( ) : numericField . getAsInt ( ) ) ) ; } else if ( fieldClass == long . class ) { mappingField . setLong ( mappingClassInstance , ( invertBitOrder ? numericField . getAsInvertedBitOrder ( ) : numericField . getAsLong ( ) ) ) ; } else if ( fieldClass == float . class ) { mappingField . setFloat ( mappingClassInstance , Float . intBitsToFloat ( invertBitOrder ? ( int ) numericField . getAsInvertedBitOrder ( ) : numericField . getAsInt ( ) ) ) ; } else if ( fieldClass == double . class ) { mappingField . setDouble ( mappingClassInstance , Double . longBitsToDouble ( invertBitOrder ? numericField . getAsInvertedBitOrder ( ) : numericField . getAsLong ( ) ) ) ; } else { throw new JBBPMapperException ( "Unsupported mapping class field type to be mapped for binary parsed data" , ( JBBPAbstractField ) numericField , mappingClassInstance . getClass ( ) , mappingField , null ) ; } } catch ( IllegalAccessException ex ) { throw new JBBPMapperException ( "Can't get access to a mapping field" , ( JBBPAbstractField ) numericField , mappingClassInstance . getClass ( ) , mappingField , ex ) ; } catch ( IllegalArgumentException ex ) { throw new JBBPMapperException ( "Can't set argument to a mapping field" , ( JBBPAbstractField ) numericField , mappingClassInstance . getClass ( ) , mappingField , ex ) ; } }
map a parsed primitive numeric field to a primitive field in a mapping class .
