com.mysema.query.types.expr
Class StringExpression

java.lang.Object
  extended by com.mysema.query.types.expr.DslExpression<T>
      extended by com.mysema.query.types.expr.SimpleExpression<T>
          extended by com.mysema.query.types.expr.ComparableExpressionBase<T>
              extended by com.mysema.query.types.expr.ComparableExpression<String>
                  extended by com.mysema.query.types.expr.StringExpression
All Implemented Interfaces:
Expression<String>, Serializable
Direct Known Subclasses:
PhraseElement, StringOperation, StringPath, StringSubQuery, StringTemplate, TermElement

public abstract class StringExpression
extends ComparableExpression<String>

StringExpression represents String expressions

Author:
tiwe
See Also:
String, Serialized Form

Field Summary
 
Fields inherited from class com.mysema.query.types.expr.DslExpression
mixin
 
Constructor Summary
StringExpression(Expression<String> mixin)
           
 
Method Summary
 StringExpression append(Expression<String> str)
          Get the concatenation of this and str
 StringExpression append(String str)
          Get the concatenation of this and str
 StringExpression as(Path<String> alias)
          Create an alias for the expression
 StringExpression as(String alias)
          Create an alias for the expression
 SimpleExpression<Character> charAt(Expression<Integer> i)
          Get the character at the given index
 SimpleExpression<Character> charAt(int i)
          Get the character at the given index
 StringExpression concat(Expression<String> str)
          Get the concatenation of this and str
 StringExpression concat(String str)
          Get the concatenation of this and str
 BooleanExpression contains(Expression<String> str)
          Returns true if the given String is contained
 BooleanExpression contains(String str)
          Returns true if the given String is contained
 BooleanExpression containsIgnoreCase(Expression<String> str)
           
 BooleanExpression containsIgnoreCase(String str)
           
 BooleanExpression endsWith(Expression<String> str)
          Returns true if this ends with str
 BooleanExpression endsWith(String str)
          Returns true if this ends with str
 BooleanExpression endsWithIgnoreCase(Expression<String> str)
           
 BooleanExpression endsWithIgnoreCase(String str)
           
 BooleanExpression equalsIgnoreCase(Expression<String> str)
          Compares this StringExpression to another StringExpression, ignoring case considerations.
 BooleanExpression equalsIgnoreCase(String str)
          Compares this StringExpression to another StringExpression, ignoring case considerations.
 NumberExpression<Integer> indexOf(Expression<String> str)
          Get the index of the given substring in this String
 NumberExpression<Integer> indexOf(Expression<String> str, int i)
          Get the index of the given substring in this String, starting from the given index
 NumberExpression<Integer> indexOf(String str)
          Get the index of the given substring in this String
 NumberExpression<Integer> indexOf(String str, int i)
          Get the index of the given substring in this String, starting from the given index
 BooleanExpression isEmpty()
          Return true if this String is empty
 BooleanExpression isNotEmpty()
          Return true if this String is not empty
 NumberExpression<Integer> length()
          Return the length of this String
 BooleanExpression like(Expression<String> str)
          Expr: this like str
 BooleanExpression like(Expression<String> str, char escape)
          Expr: this like str
 BooleanExpression like(String str)
          Expr: this like str
 BooleanExpression like(String str, char escape)
          Expr: this like str
 NumberExpression<Integer> locate(Expression<String> str)
          Get the position of the given String in this String, the first position is 1
 NumberExpression<Integer> locate(Expression<String> str, NumberExpression<Integer> start)
          Get the position of the given String in this String, the first position is 1
 NumberExpression<Integer> locate(String str)
          Get the position of the given String in this String, the first position is 1
 NumberExpression<Integer> locate(String str, int start)
          Get the position of the given String in this String, the first position is 1
 StringExpression lower()
          Get the lower case form
 BooleanExpression matches(Expression<String> regex)
          Return true if this String matches the given regular expression
 BooleanExpression matches(String regex)
          Return true if this String matches the given regular expression
 StringExpression max()
          Get the maximum value of this expression (aggregation)
 StringExpression min()
          Get the minimum value of this expression (aggregation)
 BooleanExpression notEqualsIgnoreCase(Expression<String> str)
          Compares this StringExpression to another StringExpression, ignoring case considerations.
 BooleanExpression notEqualsIgnoreCase(String str)
          Compares this StringExpression to another StringExpression, ignoring case considerations.
 BooleanExpression notLike(Expression<String> str)
          Expr: this not like str
 BooleanExpression notLike(Expression<String> str, char escape)
          Expr: this not like str
 BooleanExpression notLike(String str)
          Expr: this not like str
 BooleanExpression notLike(String str, char escape)
          Expr: this not like str
 StringExpression prepend(Expression<String> str)
          Prepend the given String and return the result
 StringExpression prepend(String str)
          Prepend the given String and return the result
 BooleanExpression startsWith(Expression<String> str)
          Return true if this starts with str
 BooleanExpression startsWith(String str)
          Return true if this starts with str
 BooleanExpression startsWithIgnoreCase(Expression<String> str)
           
 BooleanExpression startsWithIgnoreCase(String str)
           
 StringExpression stringValue()
          Get a cast to String expression
 StringExpression substring(Expression<Integer> beginIndex)
          Get the given substring
 StringExpression substring(Expression<Integer> beginIndex, Expression<Integer> endIndex)
          Get the given substring
 StringExpression substring(int beginIndex)
          Get the given substring
 StringExpression substring(int beginIndex, int endIndex)
          Get the given substring
 StringExpression toLowerCase()
          Get the lower case form
 StringExpression toUpperCase()
          Get the upper case form
 StringExpression trim()
          Get a copy of the string, with leading and trailing whitespace omitted.
 StringExpression upper()
          Get the upper case form
 
Methods inherited from class com.mysema.query.types.expr.ComparableExpression
between, between, goe, goe, goeAll, goeAny, gt, gt, gtAll, gtAny, loe, loe, loeAll, loeAny, lt, lt, ltAll, ltAny, notBetween, notBetween
 
Methods inherited from class com.mysema.query.types.expr.ComparableExpressionBase
asc, castToNum, coalesce, coalesce, desc
 
Methods inherited from class com.mysema.query.types.expr.SimpleExpression
count, countDistinct, eq, eq, eqAll, eqAny, in, in, in, isNotNull, isNull, ne, ne, neAll, neAny, notIn, notIn, notIn, when, when
 
Methods inherited from class com.mysema.query.types.expr.DslExpression
equals, getType, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.mysema.query.types.Expression
accept
 

Constructor Detail

StringExpression

public StringExpression(Expression<String> mixin)
Method Detail

as

public StringExpression as(Path<String> alias)
Description copied from class: SimpleExpression
Create an alias for the expression

Overrides:
as in class ComparableExpression<String>
Returns:

as

public StringExpression as(String alias)
Description copied from class: SimpleExpression
Create an alias for the expression

Overrides:
as in class ComparableExpression<String>
Returns:

append

public StringExpression append(Expression<String> str)
Get the concatenation of this and str

Parameters:
str -
Returns:
this + str

append

public StringExpression append(String str)
Get the concatenation of this and str

Parameters:
str -
Returns:
this + str

charAt

public SimpleExpression<Character> charAt(Expression<Integer> i)
Get the character at the given index

Parameters:
i -
Returns:
this.charAt(i)
See Also:
String.charAt(int)

charAt

public SimpleExpression<Character> charAt(int i)
Get the character at the given index

Parameters:
i -
Returns:
this.charAt(i)
See Also:
String.charAt(int)

concat

public StringExpression concat(Expression<String> str)
Get the concatenation of this and str

Parameters:
str -
Returns:
this + str

concat

public StringExpression concat(String str)
Get the concatenation of this and str

Parameters:
str -
Returns:
this + str

contains

public BooleanExpression contains(Expression<String> str)
Returns true if the given String is contained

Parameters:
str -
Returns:
this.contains(str)
See Also:
String.contains(CharSequence)

contains

public BooleanExpression contains(String str)
Returns true if the given String is contained

Parameters:
str -
Returns:
this.contains(str)
See Also:
String.contains(CharSequence)

containsIgnoreCase

public BooleanExpression containsIgnoreCase(Expression<String> str)
Parameters:
str -
Returns:

containsIgnoreCase

public BooleanExpression containsIgnoreCase(String str)
Parameters:
str -
Returns:

endsWith

public BooleanExpression endsWith(Expression<String> str)
Returns true if this ends with str

Parameters:
str -
Returns:
this.endsWith(str)
See Also:
String.endsWith(String)

endsWithIgnoreCase

public BooleanExpression endsWithIgnoreCase(Expression<String> str)
Parameters:
str -
Returns:

endsWith

public BooleanExpression endsWith(String str)
Returns true if this ends with str

Parameters:
str -
Returns:
this.endsWith(str)
See Also:
String.endsWith(String)

endsWithIgnoreCase

public BooleanExpression endsWithIgnoreCase(String str)
Parameters:
str -
Returns:

equalsIgnoreCase

public BooleanExpression equalsIgnoreCase(Expression<String> str)
Compares this StringExpression to another StringExpression, ignoring case considerations.

Parameters:
str -
Returns:
this.equalsIgnoreCase(str)
See Also:
String.equalsIgnoreCase(String)

equalsIgnoreCase

public BooleanExpression equalsIgnoreCase(String str)
Compares this StringExpression to another StringExpression, ignoring case considerations.

Parameters:
str -
Returns:
this.equalsIgnoreCase(str)
See Also:
String.equalsIgnoreCase(String)

indexOf

public NumberExpression<Integer> indexOf(Expression<String> str)
Get the index of the given substring in this String

Parameters:
str -
Returns:
this.indexOf(str)
See Also:
String.indexOf(String)

indexOf

public NumberExpression<Integer> indexOf(String str)
Get the index of the given substring in this String

Parameters:
str -
Returns:
this.indexOf(str)
See Also:
String.indexOf(String)

indexOf

public NumberExpression<Integer> indexOf(String str,
                                         int i)
Get the index of the given substring in this String, starting from the given index

Parameters:
str -
i -
Returns:
this.indexOf(str, i)
See Also:
String.indexOf(String, int)

indexOf

public NumberExpression<Integer> indexOf(Expression<String> str,
                                         int i)
Get the index of the given substring in this String, starting from the given index

Parameters:
str -
i -
Returns:

isEmpty

public BooleanExpression isEmpty()
Return true if this String is empty

Returns:
this.isEmpty()
See Also:
String.isEmpty()

isNotEmpty

public BooleanExpression isNotEmpty()
Return true if this String is not empty

Returns:
!this.isEmpty()
See Also:
String.isEmpty()

length

public NumberExpression<Integer> length()
Return the length of this String

Returns:
this.length()
See Also:
String.length()

like

public BooleanExpression like(String str)
Expr: this like str

Parameters:
str -
Returns:

like

public BooleanExpression like(Expression<String> str)
Expr: this like str

Parameters:
str -
Returns:

like

public BooleanExpression like(String str,
                              char escape)
Expr: this like str

Parameters:
str -
Returns:

like

public BooleanExpression like(Expression<String> str,
                              char escape)
Expr: this like str

Parameters:
str -
Returns:

locate

public NumberExpression<Integer> locate(Expression<String> str)
Get the position of the given String in this String, the first position is 1

Parameters:
str -
Returns:
locate(str, this)

locate

public NumberExpression<Integer> locate(String str)
Get the position of the given String in this String, the first position is 1

Parameters:
str -
Returns:
locate(str, this)

locate

public NumberExpression<Integer> locate(Expression<String> str,
                                        NumberExpression<Integer> start)
Get the position of the given String in this String, the first position is 1

Parameters:
str -
Returns:
locate(str, this, start)

locate

public NumberExpression<Integer> locate(String str,
                                        int start)
Get the position of the given String in this String, the first position is 1

Parameters:
str -
Returns:
locate(str, this, start)

lower

public StringExpression lower()
Get the lower case form

Returns:
this.toLowerCase()
See Also:
String.toLowerCase()

matches

public BooleanExpression matches(Expression<String> regex)
Return true if this String matches the given regular expression

Parameters:
regex -
Returns:
this.matches(right)
See Also:
String.matches(String)

matches

public BooleanExpression matches(String regex)
Return true if this String matches the given regular expression

Parameters:
regex -
Returns:
this.matches(regex)
See Also:
String.matches(String)

max

public StringExpression max()
Get the maximum value of this expression (aggregation)

Returns:
max(this)

min

public StringExpression min()
Get the minimum value of this expression (aggregation)

Returns:
min(this)

notEqualsIgnoreCase

public BooleanExpression notEqualsIgnoreCase(Expression<String> str)
Compares this StringExpression to another StringExpression, ignoring case considerations.

Parameters:
str -
Returns:
!this.equalsIgnoreCase(str)
See Also:
String.equalsIgnoreCase(String)

notEqualsIgnoreCase

public BooleanExpression notEqualsIgnoreCase(String str)
Compares this StringExpression to another StringExpression, ignoring case considerations.

Parameters:
str -
Returns:
!this.equalsIgnoreCase(str)
See Also:
String.equalsIgnoreCase(String)

notLike

public BooleanExpression notLike(String str)
Expr: this not like str

Parameters:
str -
Returns:

notLike

public BooleanExpression notLike(Expression<String> str)
Expr: this not like str

Parameters:
str -
Returns:

notLike

public BooleanExpression notLike(String str,
                                 char escape)
Expr: this not like str

Parameters:
str -
Returns:

notLike

public BooleanExpression notLike(Expression<String> str,
                                 char escape)
Expr: this not like str

Parameters:
str -
Returns:

prepend

public StringExpression prepend(Expression<String> str)
Prepend the given String and return the result

Parameters:
str -
Returns:
str + this

prepend

public StringExpression prepend(String str)
Prepend the given String and return the result

Parameters:
str -
Returns:
str + this

startsWith

public BooleanExpression startsWith(Expression<String> str)
Return true if this starts with str

Parameters:
str -
Returns:
this.startsWith(str)
See Also:
String.startsWith(String)

startsWithIgnoreCase

public BooleanExpression startsWithIgnoreCase(Expression<String> str)
Parameters:
str -
Returns:

startsWith

public BooleanExpression startsWith(String str)
Return true if this starts with str

Parameters:
str -
Returns:
this.startsWith(str)
See Also:
String.startsWith(String)

startsWithIgnoreCase

public BooleanExpression startsWithIgnoreCase(String str)
Parameters:
str -
Returns:

stringValue

public StringExpression stringValue()
Description copied from class: ComparableExpressionBase
Get a cast to String expression

Overrides:
stringValue in class ComparableExpressionBase<String>
Returns:
See Also:
Object.toString()

substring

public StringExpression substring(int beginIndex)
Get the given substring

Parameters:
beginIndex -
Returns:
this.substring(beginIndex)
See Also:
String.substring(int)

substring

public StringExpression substring(int beginIndex,
                                  int endIndex)
Get the given substring

Parameters:
beginIndex -
endIndex -
Returns:
this.substring(beginIndex, endIndex)
See Also:
String.substring(int, int)

substring

public StringExpression substring(Expression<Integer> beginIndex)
Get the given substring

Parameters:
beginIndex -
Returns:
this.substring(beginIndex)
See Also:
String.substring(int)

substring

public StringExpression substring(Expression<Integer> beginIndex,
                                  Expression<Integer> endIndex)
Get the given substring

Parameters:
beginIndex -
endIndex -
Returns:
this.substring(beginIndex, endIndex)
See Also:
String.substring(int, int)

toLowerCase

public StringExpression toLowerCase()
Get the lower case form

Returns:
this.toLowerCase()
See Also:
String.toLowerCase()

toUpperCase

public StringExpression toUpperCase()
Get the upper case form

Returns:
See Also:
String.toUpperCase()

trim

public StringExpression trim()
Get a copy of the string, with leading and trailing whitespace omitted.

Returns:
See Also:
String.trim()

upper

public StringExpression upper()
Get the upper case form

Returns:
See Also:
String.toUpperCase()


Copyright © 2007-2012 Mysema Ltd. All Rights Reserved.