public abstract class BinaryDefault
extends java.lang.Object
Static functions to apply default values of type binary
.
Constructor and Description |
---|
BinaryDefault() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
emptyIfNull(byte[] value)
Return
value if it is not null , otherwise return empty string. |
static byte[] |
ifEmpty(byte[] value,
byte[] defaultValue)
Return
value if it is not null or empty, otherwise return defaultValue . |
static byte[] |
ifNull(byte[] value,
byte[] defaultValue)
Return
value if it is not null , otherwise return defaultValue . |
static byte[] |
nullIfEmpty(byte[] value)
Return (nullable)
null if value is null or empty, otherwise return value . |
public static byte[] emptyIfNull(byte[] value)
Return value
if it is not null
, otherwise return empty string.
value
- (nullable) Nullable value.value
if it is not null
, otherwise return empty string.public static byte[] ifEmpty(byte[] value, byte[] defaultValue)
Return value
if it is not null
or empty, otherwise return defaultValue
.
value
- (nullable) Nullable value.defaultValue
- Default value.value
if it is not null
or empty, otherwise return defaultValue
.public static byte[] ifNull(byte[] value, byte[] defaultValue)
Return value
if it is not null
, otherwise return defaultValue
.
value
- (nullable) Nullable value.defaultValue
- Default value.value
if it is not null
, otherwise return defaultValue
.public static byte[] nullIfEmpty(byte[] value)
Return (nullable) null
if value
is null
or empty, otherwise return value
.
value
- (nullable) Nullable value.null
if value
is null
or empty, otherwise return value
.