3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-13 02:35:52 +00:00

Sha256Hash: Remove deprecated methods.

This commit is contained in:
Andreas Schildbach 2019-02-21 22:35:53 +01:00
parent 53bd04e426
commit 029d096d8a

View File

@ -41,24 +41,11 @@ public class Sha256Hash implements Serializable, Comparable<Sha256Hash> {
private final byte[] bytes;
/**
* Use {@link #wrap(byte[])} instead.
*/
@Deprecated
public Sha256Hash(byte[] rawHashBytes) {
private Sha256Hash(byte[] rawHashBytes) {
checkArgument(rawHashBytes.length == LENGTH);
this.bytes = rawHashBytes;
}
/**
* Use {@link #wrap(String)} instead.
*/
@Deprecated
public Sha256Hash(String hexString) {
checkArgument(hexString.length() == LENGTH * 2);
this.bytes = Utils.HEX.decode(hexString);
}
/**
* Creates a new instance that wraps the given hash value.
*
@ -66,7 +53,6 @@ public class Sha256Hash implements Serializable, Comparable<Sha256Hash> {
* @return a new instance
* @throws IllegalArgumentException if the given array length is not exactly 32
*/
@SuppressWarnings("deprecation") // the constructor will be made private in the future
public static Sha256Hash wrap(byte[] rawHashBytes) {
return new Sha256Hash(rawHashBytes);
}
@ -90,17 +76,10 @@ public class Sha256Hash implements Serializable, Comparable<Sha256Hash> {
* @return a new instance
* @throws IllegalArgumentException if the given array length is not exactly 32
*/
@SuppressWarnings("deprecation") // the constructor will be made private in the future
public static Sha256Hash wrapReversed(byte[] rawHashBytes) {
return wrap(Utils.reverseBytes(rawHashBytes));
}
/** Use {@link #of(byte[])} instead: this old name is ambiguous. */
@Deprecated
public static Sha256Hash create(byte[] contents) {
return of(contents);
}
/**
* Creates a new instance containing the calculated (one-time) hash of the given bytes.
*
@ -111,12 +90,6 @@ public class Sha256Hash implements Serializable, Comparable<Sha256Hash> {
return wrap(hash(contents));
}
/** Use {@link #twiceOf(byte[])} instead: this old name is ambiguous. */
@Deprecated
public static Sha256Hash createDouble(byte[] contents) {
return twiceOf(contents);
}
/**
* Creates a new instance containing the hash of the calculated hash of the given bytes.
*