net.esper.view
Class PropertyCheckHelper

java.lang.Object
  extended by net.esper.view.PropertyCheckHelper

public final class PropertyCheckHelper
extends Object

Utility class for checking in a schema if fields exist and/or have an expected type.


Constructor Summary
PropertyCheckHelper()
           
 
Method Summary
static String checkLong(EventType type, String longFieldName)
          Check if the field identified by the field name is of type long according to the schema.
static String checkNumeric(EventType type, String numericFieldName)
          Check if the field identified by the field name is a valid numeric field according to the schema.
static String checkNumeric(EventType type, String numericFieldNameX, String numericFieldNameY)
          Check if the fields identified by their field names are valid numeric field according to the schema.
static String exists(EventType type, String fieldName)
          Check if the field identified by the field name exists according to the schema.
static String exists(EventType type, String fieldNameOne, String fieldNameTwo)
          Check if the fields identified by the field names both exists according to the schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyCheckHelper

public PropertyCheckHelper()
Method Detail

exists

public static String exists(EventType type,
                            String fieldName)
Check if the field identified by the field name exists according to the schema.

Parameters:
type - contains metadata about fields
fieldName - is the field's field name to test
Returns:
a String error message if the field doesn't exist, or null to indicate success

exists

public static String exists(EventType type,
                            String fieldNameOne,
                            String fieldNameTwo)
Check if the fields identified by the field names both exists according to the schema.

Parameters:
type - contains metadata about fields
fieldNameOne - is the first field's field name to test
fieldNameTwo - is the first field's field name to test
Returns:
a String error message if either of the fields doesn't exist, or null to indicate success

checkNumeric

public static String checkNumeric(EventType type,
                                  String numericFieldName)
Check if the field identified by the field name is a valid numeric field according to the schema.

Parameters:
type - contains metadata about fields
numericFieldName - is the field's field name to test
Returns:
a String error message if the field doesn't exist or is not numeric, or null to indicate success

checkNumeric

public static String checkNumeric(EventType type,
                                  String numericFieldNameX,
                                  String numericFieldNameY)
Check if the fields identified by their field names are valid numeric field according to the schema.

Parameters:
type - contains metadata about fields
numericFieldNameX - is the first field's field name to test
numericFieldNameY - is the second field's field name to test
Returns:
a String error message if the field doesn't exist or is not numeric, or null to indicate success

checkLong

public static String checkLong(EventType type,
                               String longFieldName)
Check if the field identified by the field name is of type long according to the schema.

Parameters:
type - contains metadata about fields
longFieldName - is the field's field name to test
Returns:
a String error message if the field doesn't exist or is not a long, or null to indicate success

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com