本文整理匯總了Java中com.thinkaurelius.titan.graphdb.database.serialize.Serializer.readObjectNotNull方法的典型用法代碼示例。如果您正苦於以下問題:Java Serializer.readObjectNotNull方法的具體用法?Java Serializer.readObjectNotNull怎麽用?Java Serializer.readObjectNotNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.thinkaurelius.titan.graphdb.database.serialize.Serializer
的用法示例。
在下文中一共展示了Serializer.readObjectNotNull方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parse
import com.thinkaurelius.titan.graphdb.database.serialize.Serializer; //導入方法依賴的package包/類
public static Entry parse(StaticBuffer buffer, Serializer serializer, TimestampProvider times) {
ReadBuffer read = buffer.asReadBuffer();
Instant txTimestamp = times.getTime(read.getLong());
TransactionLogHeader header = new TransactionLogHeader(VariableLong.readPositive(read),
txTimestamp, times);
LogTxStatus status = serializer.readObjectNotNull(read,LogTxStatus.class);
EnumMap<LogTxMeta,Object> metadata = new EnumMap<LogTxMeta, Object>(LogTxMeta.class);
int metaSize = VariableLong.unsignedByte(read.getByte());
for (int i=0;i<metaSize;i++) {
LogTxMeta meta = LogTxMeta.values()[VariableLong.unsignedByte(read.getByte())];
metadata.put(meta,serializer.readObjectNotNull(read,meta.dataType()));
}
if (read.hasRemaining()) {
StaticBuffer content = read.subrange(read.getPosition(),read.length()-read.getPosition());
return new Entry(header,content, status,metadata);
} else {
return new Entry(header,null, status,metadata);
}
}
示例2: parse
import com.thinkaurelius.titan.graphdb.database.serialize.Serializer; //導入方法依賴的package包/類
public static Entry parse(StaticBuffer buffer, Serializer serializer, TimestampProvider times) {
ReadBuffer read = buffer.asReadBuffer();
Timepoint txTimestamp = new StandardTimepoint(read.getLong(), times);
TransactionLogHeader header = new TransactionLogHeader(VariableLong.readPositive(read),
txTimestamp);
LogTxStatus status = serializer.readObjectNotNull(read,LogTxStatus.class);
EnumMap<LogTxMeta,Object> metadata = new EnumMap<LogTxMeta, Object>(LogTxMeta.class);
int metaSize = VariableLong.unsignedByte(read.getByte());
for (int i=0;i<metaSize;i++) {
LogTxMeta meta = LogTxMeta.values()[VariableLong.unsignedByte(read.getByte())];
metadata.put(meta,serializer.readObjectNotNull(read,meta.dataType()));
}
if (read.hasRemaining()) {
StaticBuffer content = read.subrange(read.getPosition(),read.length()-read.getPosition());
return new Entry(header,content, status,metadata);
} else {
return new Entry(header,null, status,metadata);
}
}