Class Scn

java.lang.Object
io.debezium.connector.oracle.Scn
All Implemented Interfaces:
Comparable<Scn>

public class Scn extends Object implements Comparable<Scn>
Oracle System Change Number implementation
Author:
Chris Cranford
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Scn
    Represents an Scn that implies the maximum possible value of an SCN, useful as a placeholder.
    static final Scn
    Represents an Scn without a value.
    static final Scn
    Represents an Scn with value 1, useful for playing with inclusive/exclusive query boundaries.
    private final BigInteger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    add(Scn value)
    Returns a SCn whose value is (this + value).
     
    int
    Compares this Scn with the specified Scn.
    boolean
     
    int
     
    boolean
    Returns whether this Scn is null and contains no value.
    long
    Get the Scn represented as a long data type.
    subtract(Scn value)
    Returns a Scn whose value is (this - value).
     
    static Scn
    valueOf(int value)
    Construct a Scn from an integer value.
    static Scn
    valueOf(long value)
    Construct a Scn from a long value.
    static Scn
    valueOf(String value)
    Construct a Scn from a string value.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • MAX

      public static final Scn MAX
      Represents an Scn that implies the maximum possible value of an SCN, useful as a placeholder.
    • NULL

      public static final Scn NULL
      Represents an Scn without a value.
    • ONE

      public static final Scn ONE
      Represents an Scn with value 1, useful for playing with inclusive/exclusive query boundaries.
    • scn

      private final BigInteger scn
  • Constructor Details

  • Method Details

    • isNull

      public boolean isNull()
      Returns whether this Scn is null and contains no value.
    • valueOf

      public static Scn valueOf(int value)
      Construct a Scn from an integer value.
      Parameters:
      value - integer value
      Returns:
      instance of Scn
    • valueOf

      public static Scn valueOf(long value)
      Construct a Scn from a long value.
      Parameters:
      value - long value
      Returns:
      instance of Scn
    • valueOf

      public static Scn valueOf(String value)
      Construct a Scn from a string value.
      Parameters:
      value - string value, should not be null
      Returns:
      instance of Scn
    • longValue

      public long longValue()
      Get the Scn represented as a long data type.
    • asBigInteger

      public BigInteger asBigInteger()
    • add

      public Scn add(Scn value)
      Returns a SCn whose value is (this + value).
      Parameters:
      value - the value to be added to this Scn.
      Returns:
      this + value
    • subtract

      public Scn subtract(Scn value)
      Returns a Scn whose value is (this - value).
      Parameters:
      value - the value to be subtracted from this Scn.
      Returns:
      this - value
    • compareTo

      public int compareTo(Scn o)
      Compares this Scn with the specified Scn.
      Specified by:
      compareTo in interface Comparable<Scn>
      Parameters:
      o - Scn to which this Scn is to be compared
      Returns:
      -1, 0, or 1 as this {code Scn} is numerically less than, equal to, or greater than o.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object