public static Map<String, Object> tupleToMap(Tuple tuple) {
if (tuple == null) {
return null;
}
Map<String, Object> snapshot;
TupleSnapshot snapshotInstance = tuple.getSnapshot();
if ( snapshotInstance.isEmpty() ) {
//new assoc tuples are made of EmptyTupleSnapshot
snapshot = Collections.emptyMap();
}
else {
//loaded assoc tuples are made of MapTupleSnapshot