com.espertech.esper.view
Class PropertyCheckHelper

java.lang.Object
  extended by com.espertech.esper.view.PropertyCheckHelper

public final class PropertyCheckHelper
extends java.lang.Object

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


Constructor Summary
PropertyCheckHelper()
           
 
Method Summary
static java.lang.String checkLong(EventType type, java.lang.String longFieldName)
          Check if the field identified by the field name is of type long according to the schema.
static java.lang.String checkNumeric(EventType type, java.lang.String numericFieldName)
          Check if the field identified by the field name is a valid numeric field according to the schema.
static java.lang.String checkNumeric(EventType type, java.lang.String numericFieldNameX, java.lang.String numericFieldNameY)
          Check if the fields identified by their field names are valid numeric field according to the schema.
static java.lang.String exists(EventType type, java.lang.String fieldName)
          Check if the field identified by the field name exists according to the schema.
static java.lang.String exists(EventType type, java.lang.String fieldNameOne, java.lang.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 java.lang.String exists(EventType type,
                                      java.lang.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 java.lang.String exists(EventType type,
                                      java.lang.String fieldNameOne,
                                      java.lang.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 java.lang.String checkNumeric(EventType type,
                                            java.lang.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 java.lang.String checkNumeric(EventType type,
                                            java.lang.String numericFieldNameX,
                                            java.lang.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 java.lang.String checkLong(EventType type,
                                         java.lang.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

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com