public abstract class NullableString
extends java.lang.Object
Functions for the implementation of nullable string
.
Constructor and Description |
---|
NullableString() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equal(java.lang.String left,
java.lang.String right)
Return
true if left == right , otherwise false . |
static java.lang.String |
getValue(java.lang.String value)
Return non-
null value. |
static boolean |
hasValue(java.lang.String left,
java.lang.String right)
Return
true if left == right , otherwise false . |
static boolean |
isNull(java.lang.String value)
Return
true if value is null , otherwise false . |
static int |
lengthWithDefault(java.lang.String value,
int defaultLength)
Return
value.length if value is non-null, otherwise return defaultLength . |
static boolean |
notEqual(java.lang.String left,
java.lang.String right)
Return
true if left != right , otherwise false . |
static boolean |
notNull(java.lang.String value)
Return
true if value is not null , otherwise false . |
static java.lang.String |
nullValue()
Return (nullable) The
null string value. |
static java.lang.String |
toString(java.lang.String value)
Return "null" if
value is null , otherwise value.toString() . |
static java.lang.String |
withValue(java.lang.String value)
Return (nullable)
value , converted to a nullable string . |
public static boolean equal(java.lang.String left, java.lang.String right)
Return true
if left == right
, otherwise false
.
left
- (nullable) Left operand.right
- (nullable) Right operand.true
if left == right
, otherwise false
.public static java.lang.String getValue(java.lang.String value)
Return non-null
value.
NullValueException
if value
is null
.
value
- (nullable) Nullable value.public static boolean hasValue(java.lang.String left, java.lang.String right)
Return true
if left == right
, otherwise false
.
left
- (nullable) Left operand.right
- Right operand.true
if left == right
, otherwise false
.public static boolean isNull(java.lang.String value)
Return true
if value
is null
, otherwise false
.
value
- (nullable) Argument value.true
if value
is null
, otherwise false
.public static int lengthWithDefault(java.lang.String value, int defaultLength)
Return value.length
if value is non-null, otherwise return defaultLength
.
value
- (nullable) Nullable value.defaultLength
- Default length.value.length
if value is non-null, otherwise return defaultLength
.public static boolean notEqual(java.lang.String left, java.lang.String right)
Return true
if left != right
, otherwise false
.
left
- (nullable) Left operand.right
- (nullable) Right operand.true
if left != right
, otherwise false
.public static boolean notNull(java.lang.String value)
Return true
if value
is not null
, otherwise false
.
value
- (nullable) Argument value.true
if value
is not null
, otherwise false
.public static java.lang.String nullValue()
Return (nullable) The null
string
value.
null
string
value.public static java.lang.String toString(java.lang.String value)
Return "null" if value
is null
, otherwise value.toString()
.
value
- (nullable) Argument value.value
is null
, otherwise value.toString()
.public static java.lang.String withValue(java.lang.String value)
Return (nullable) value
, converted to a nullable string
.
value
- Argument value.value
, converted to a nullable string
.