blackboard.persist
Enum SearchOperator

java.lang.Object
  extended by java.lang.Enum<SearchOperator>
      extended by blackboard.persist.SearchOperator
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SearchOperator>

public enum SearchOperator
extends java.lang.Enum<SearchOperator>

Set of operators to use in search methods.


Enum Constant Summary
Between
           
Contains
           
Equals
           
GreaterThan
           
In
           
IsNotNull
           
IsNull
           
LessThan
           
Like
           
NotBlank
           
StartsWith
           
 
Method Summary
 Criterion buildCriteria(CriterionBuilder builder, java.lang.String name, java.lang.Object... values)
          Builds a Criterion that conforms to the current operator using the given name and value.
 boolean dateOperator()
          Returns true if the operator can be used in date comparisons
 java.lang.String formatValue(java.lang.String in)
          Formats the input value depending on the type of operation, notably textual "like" operations.
static java.util.List<SearchOperator> getDefaultSearchBarOperators()
           
 java.lang.String getLabel()
           
 boolean numericOperator()
          Returns true if the operator can be used in numeric comparisons
 boolean requiresInput()
           
 boolean textOperator()
          Returns whether the operator can be used for text parameters.
static SearchOperator valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SearchOperator[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

GreaterThan

public static final SearchOperator GreaterThan

LessThan

public static final SearchOperator LessThan

Equals

public static final SearchOperator Equals

Contains

public static final SearchOperator Contains

StartsWith

public static final SearchOperator StartsWith

Like

public static final SearchOperator Like

Between

public static final SearchOperator Between

In

public static final SearchOperator In

IsNull

public static final SearchOperator IsNull

IsNotNull

public static final SearchOperator IsNotNull

NotBlank

public static final SearchOperator NotBlank
Method Detail

values

public static final SearchOperator[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SearchOperator c : SearchOperator.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static SearchOperator valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getLabel

public java.lang.String getLabel()

getDefaultSearchBarOperators

public static java.util.List<SearchOperator> getDefaultSearchBarOperators()

formatValue

public java.lang.String formatValue(java.lang.String in)
Formats the input value depending on the type of operation, notably textual "like" operations. Other operators leave the input value untouched.

Parameters:
in - Parameter to format
Returns:
String appropriate for the operator; e.g., "input%" for StartsWith

textOperator

public boolean textOperator()
Returns whether the operator can be used for text parameters.

Returns:
True

dateOperator

public boolean dateOperator()
Returns true if the operator can be used in date comparisons

Returns:
True for GreaterThan, LessThan, Equals, and IsNull

numericOperator

public boolean numericOperator()
Returns true if the operator can be used in numeric comparisons

Returns:
true for GreaterThan, LessThan, Equals, IsNull

buildCriteria

public Criterion buildCriteria(CriterionBuilder builder,
                               java.lang.String name,
                               java.lang.Object... values)
Builds a Criterion that conforms to the current operator using the given name and value. Text-based comparisons will be performed in a case- insensitive manner.

Parameters:
builder - the CriterionBuilder that will be used to build the Criterion
name - the attribute name to use in the criteria
value - the value to use in the criteria

requiresInput

public boolean requiresInput()


Copyright © 2003 Blackboard, Inc. All Rights Reserved.