liquibase.change
Class CheckSum

java.lang.Object
  extended by liquibase.change.CheckSum

public class CheckSum
extends Object

CheckSums are used by liquibase to determine if a Change has been modified since it was originally ran. CheckSums can be computed on either a String or an InputStream. The CheckSum contains a version number which can be used to determine whether the algorithm for computing a checksum has changed since the last time it was computed. If the algorithm changes, we cannot rely on the checksum value.

It is not up to this class to determine what should be checksum-ed, it simply hashes what is passed to it.


Method Summary
static CheckSum compute(InputStream stream, boolean standardizeLineEndings)
          Compute a checksum of the given data stream.
static CheckSum compute(String valueToChecksum)
          Compute a checksum of the given string.
 boolean equals(Object obj)
           
static int getCurrentVersion()
          Return the current CheckSum algorithm version.
 int getVersion()
          Return the Checksum Algorithm version for this CheckSum
 int hashCode()
           
static CheckSum parse(String checksumValue)
          Parse the given checksum string value into a CheckSum object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

parse

public static CheckSum parse(String checksumValue)
Parse the given checksum string value into a CheckSum object.


getCurrentVersion

public static int getCurrentVersion()
Return the current CheckSum algorithm version.


compute

public static CheckSum compute(String valueToChecksum)
Compute a checksum of the given string.


compute

public static CheckSum compute(InputStream stream,
                               boolean standardizeLineEndings)
Compute a checksum of the given data stream.


toString

public String toString()
Overrides:
toString in class Object

getVersion

public int getVersion()
Return the Checksum Algorithm version for this CheckSum


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013 Liquibase.org. All Rights Reserved.