Debian Codegraph @

src/main/org/h2/value/VersionedValue.java

raw
1 /*
2 * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (https://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6 package org.h2.value;
7
8 /**
9 * A versioned value (possibly null).
10 * It contains current value and latest committed value if current one is uncommitted.
11 * Also for uncommitted values it contains operationId - a combination of
12 * transactionId and logId.
13 */
14 public class VersionedValue<T> {
15
16 protected VersionedValue() {}
17
18 public boolean isCommitted() {
19 return true;
20 }
21
22 public long getOperationId() {
23 return 0L;
24 }
25
26 @SuppressWarnings("unchecked")
27 public T getCurrentValue() {
28 return (T)this;
29 }
30
31 @SuppressWarnings("unchecked")
32 public T getCommittedValue() {
33 return (T)this;
34 }
35
36 }