本文整理汇总了Java中org.apache.gora.mongodb.utils.BSONDecorator.getLong方法的典型用法代码示例。如果您正苦于以下问题:Java BSONDecorator.getLong方法的具体用法?Java BSONDecorator.getLong怎么用?Java BSONDecorator.getLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.gora.mongodb.utils.BSONDecorator
的用法示例。
在下文中一共展示了BSONDecorator.getLong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromDBObject
import org.apache.gora.mongodb.utils.BSONDecorator; //导入方法依赖的package包/类
private Object fromDBObject(final Schema fieldSchema,
final DocumentFieldType storeType, final Field field, final String docf,
final BSONDecorator easybson) {
Object result = null;
switch (fieldSchema.getType()) {
case MAP:
result = fromMongoMap(docf, fieldSchema, easybson, field);
break;
case ARRAY:
result = fromMongoList(docf, fieldSchema, easybson, field);
break;
case RECORD:
DBObject rec = easybson.getDBObject(docf);
if (rec == null) {
result = null;
break;
}
result = fromMongoRecord(fieldSchema, docf, rec);
break;
case BOOLEAN:
result = easybson.getBoolean(docf);
break;
case DOUBLE:
result = easybson.getDouble(docf);
break;
case FLOAT:
result = easybson.getDouble(docf).floatValue();
break;
case INT:
result = easybson.getInt(docf);
break;
case LONG:
result = easybson.getLong(docf);
break;
case STRING:
result = fromMongoString(storeType, docf, easybson);
break;
case ENUM:
result = AvroUtils.getEnumValue(fieldSchema, easybson.getUtf8String(docf)
.toString());
break;
case BYTES:
case FIXED:
result = easybson.getBytes(docf);
break;
case NULL:
result = null;
break;
case UNION:
result = fromMongoUnion(fieldSchema, storeType, field, docf, easybson);
break;
default:
LOG.warn("Unable to read {}", docf);
break;
}
return result;
}