public abstract class StringExpression extends Object implements ObservableStringValue
StringExpression
is a
ObservableStringValue
plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of StringExpression
has to implement the method
ObservableObjectValue.get()
, which provides the
actual value of this expression.
Note: all implementation of BooleanBinding
returned by the comparisons in this class consider a String
that is
null
equal to an empty String
.
Constructor and Description |
---|
StringExpression() |
Modifier and Type | Method and Description |
---|---|
StringExpression |
concat(Object other)
Returns a
StringExpression that holds the value of this
StringExpression concatenated with another Object . |
String |
getValue()
Returns the current value of this
ObservableValue |
String |
getValueSafe()
Returns usually the value of this
StringExpression . |
BooleanBinding |
greaterThan(ObservableStringValue other)
Creates a new
BooleanBinding that holds true
if this StringExpression is greater than another
ObservableStringValue . |
BooleanBinding |
greaterThan(String other)
Creates a new
BooleanBinding that holds true
if this StringExpression is greater than a constant value. |
BooleanBinding |
greaterThanOrEqualTo(ObservableStringValue other)
Creates a new
BooleanBinding that holds true
if this StringExpression is greater than or equal to another
ObservableStringValue . |
BooleanBinding |
greaterThanOrEqualTo(String other)
Creates a new
BooleanBinding that holds true
if this StringExpression is greater than or equal to a constant
value. |
BooleanBinding |
isEmpty()
|
BooleanBinding |
isEqualTo(ObservableStringValue other)
|
BooleanBinding |
isEqualTo(String other)
|
BooleanBinding |
isEqualToIgnoreCase(ObservableStringValue other)
Creates a new
BooleanBinding that holds true
if this and another ObservableStringValue are
equal ignoring case. |
BooleanBinding |
isEqualToIgnoreCase(String other)
Creates a new
BooleanBinding that holds true
if this StringExpression is equal to a constant value ignoring
case. |
BooleanBinding |
isNotEmpty()
|
BooleanBinding |
isNotEqualTo(ObservableStringValue other)
Creates a new
BooleanBinding that holds true
if this and another ObservableStringValue are
not equal. |
BooleanBinding |
isNotEqualTo(String other)
Creates a new
BooleanBinding that holds true
if this StringExpression is not equal to a constant value. |
BooleanBinding |
isNotEqualToIgnoreCase(ObservableStringValue other)
Creates a new
BooleanBinding that holds true
if this and another ObservableStringValue are
not equal ignoring case. |
BooleanBinding |
isNotEqualToIgnoreCase(String other)
Creates a new
BooleanBinding that holds true
if this StringExpression is not equal to a constant value
ignoring case. |
BooleanBinding |
isNotNull()
|
BooleanBinding |
isNull()
|
IntegerBinding |
length()
Creates a new
IntegerBinding that holds the length of this
StringExpression . |
BooleanBinding |
lessThan(ObservableStringValue other)
Creates a new
BooleanBinding that holds true
if this StringExpression is less than another
ObservableStringValue . |
BooleanBinding |
lessThan(String other)
Creates a new
BooleanBinding that holds true
if this StringExpression is less than a constant value. |
BooleanBinding |
lessThanOrEqualTo(ObservableStringValue other)
Creates a new
BooleanBinding that holds true
if this StringExpression is less than or equal to another
ObservableStringValue . |
BooleanBinding |
lessThanOrEqualTo(String other)
Creates a new
BooleanBinding that holds true
if this StringExpression is less than or equal to a constant
value. |
static StringExpression |
stringExpression(ObservableValue<?> value)
Returns a
StringExpression that wraps a
ObservableValue . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
addListener, removeListener
addListener, removeListener
public String getValue()
ObservableValue
ObservableValue
getValue
in interface ObservableValue<String>
public final String getValueSafe()
StringExpression
. Only if the
value is null
an empty String
is returned instead.StringExpression
or the empty
String
public static StringExpression stringExpression(ObservableValue<?> value)
StringExpression
that wraps a
ObservableValue
. If the
ObservableValue
is already a StringExpression
, it will be
returned. Otherwise a new StringBinding
is
created that holds the value of the ObservableValue
converted to
a String
.value
- The source ObservableValue
StringExpression
that wraps the ObservableValue
if necessaryNullPointerException
- if value
is null
public StringExpression concat(Object other)
StringExpression
that holds the value of this
StringExpression
concatenated with another Object
.
If the value of this StringExpression
changes, the value of the
resulting StringExpression
is updated automatically. Also if the
other Object
is an implementation of
ObservableValue
, changes in the other
Object
are reflected automatically in the resulting
StringExpression
.
other
- the other Object
StringExpression
public BooleanBinding isEqualTo(ObservableStringValue other)
BooleanBinding
that holds true
if this and another ObservableStringValue
are
equal.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding isEqualTo(String other)
BooleanBinding
that holds true
if this StringExpression
is equal to a constant value.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding isNotEqualTo(ObservableStringValue other)
BooleanBinding
that holds true
if this and another ObservableStringValue
are
not equal.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding isNotEqualTo(String other)
BooleanBinding
that holds true
if this StringExpression
is not equal to a constant value.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding isEqualToIgnoreCase(ObservableStringValue other)
BooleanBinding
that holds true
if this and another ObservableStringValue
are
equal ignoring case.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the second ObservableStringValue
BooleanBinding
public BooleanBinding isEqualToIgnoreCase(String other)
BooleanBinding
that holds true
if this StringExpression
is equal to a constant value ignoring
case.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding isNotEqualToIgnoreCase(ObservableStringValue other)
BooleanBinding
that holds true
if this and another ObservableStringValue
are
not equal ignoring case.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the second ObservableStringValue
BooleanBinding
public BooleanBinding isNotEqualToIgnoreCase(String other)
BooleanBinding
that holds true
if this StringExpression
is not equal to a constant value
ignoring case.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding greaterThan(ObservableStringValue other)
BooleanBinding
that holds true
if this StringExpression
is greater than another
ObservableStringValue
.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the second ObservableStringValue
BooleanBinding
public BooleanBinding greaterThan(String other)
BooleanBinding
that holds true
if this StringExpression
is greater than a constant value.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding lessThan(ObservableStringValue other)
BooleanBinding
that holds true
if this StringExpression
is less than another
ObservableStringValue
.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the second ObservableStringValue
BooleanBinding
public BooleanBinding lessThan(String other)
BooleanBinding
that holds true
if this StringExpression
is less than a constant value.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding greaterThanOrEqualTo(ObservableStringValue other)
BooleanBinding
that holds true
if this StringExpression
is greater than or equal to another
ObservableStringValue
.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the second ObservableStringValue
BooleanBinding
public BooleanBinding greaterThanOrEqualTo(String other)
BooleanBinding
that holds true
if this StringExpression
is greater than or equal to a constant
value.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding lessThanOrEqualTo(ObservableStringValue other)
BooleanBinding
that holds true
if this StringExpression
is less than or equal to another
ObservableStringValue
.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the second ObservableStringValue
BooleanBinding
public BooleanBinding lessThanOrEqualTo(String other)
BooleanBinding
that holds true
if this StringExpression
is less than or equal to a constant
value.
Note: In this comparison a String
that is null
is
considered equal to an empty String
.
other
- the constant valueBooleanBinding
public BooleanBinding isNull()
BooleanBinding
public BooleanBinding isNotNull()
BooleanBinding
public IntegerBinding length()
IntegerBinding
that holds the length of this
StringExpression
.
Note: If the value of this StringExpression
is null
,
the length is considered to be 0
.
IntegerBinding
public BooleanBinding isEmpty()
BooleanBinding
that holds true
if this
StringExpression
is empty.
Note: If the value of this StringExpression
is null
,
it is considered to be empty.
BooleanBinding
public BooleanBinding isNotEmpty()
BooleanBinding
that holds true
if this
StringExpression
is not empty.
Note: If the value of this StringExpression
is null
,
it is considered to be empty.
BooleanBinding
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.