forked from TrueCloudLab/frostfs-sdk-java
parent
441d3129dc
commit
0d76332f01
1 changed files with 3 additions and 3 deletions
|
@ -9,14 +9,14 @@ import java.io.IOException;
|
||||||
import static java.util.Objects.isNull;
|
import static java.util.Objects.isNull;
|
||||||
|
|
||||||
public class SessionMapper {
|
public class SessionMapper {
|
||||||
private static final String ERROR_TOKEN_MISSING_ERROR = "Token is not present";
|
private static final String ERROR_TOKEN_MISSING_MESSAGE = "Token is not present";
|
||||||
|
|
||||||
private SessionMapper() {
|
private SessionMapper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] serialize(Types.SessionToken token) {
|
public static byte[] serialize(Types.SessionToken token) {
|
||||||
if (isNull(token)) {
|
if (isNull(token)) {
|
||||||
throw new IllegalArgumentException(ERROR_TOKEN_MISSING_ERROR);
|
throw new IllegalArgumentException(ERROR_TOKEN_MISSING_MESSAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -31,7 +31,7 @@ public class SessionMapper {
|
||||||
|
|
||||||
public static Types.SessionToken deserializeSessionToken(byte[] bytes) {
|
public static Types.SessionToken deserializeSessionToken(byte[] bytes) {
|
||||||
if (isNull(bytes) || bytes.length == 0) {
|
if (isNull(bytes) || bytes.length == 0) {
|
||||||
throw new IllegalArgumentException(ERROR_TOKEN_MISSING_ERROR);
|
throw new IllegalArgumentException(ERROR_TOKEN_MISSING_MESSAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue