com.codestreet.messageforge
Class RFldConstraintI8Enum

java.lang.Object
  extended bycom.codestreet.messageforge.RFldConstraintI8
      extended bycom.codestreet.messageforge.RFldConstraintI8Enum
All Implemented Interfaces:
RFldConstraint, RFldConstraintNumeric

public class RFldConstraintI8Enum
extends RFldConstraintI8

Class to represent an enumeration constraint on a byte message field.

Author:
Jawaid Hakim.

Field Summary
protected  byte[] enums_
          Enumeration of allowed values.
 
Constructor Summary
RFldConstraintI8Enum(java.lang.String fldName, byte[] enums)
          Constructor.
RFldConstraintI8Enum(java.lang.String fldName, java.lang.String[] enums)
          Constructor.
 
Method Summary
 java.lang.String errDesc(java.lang.String fldName)
          Get error description.
 boolean isValid(byte val)
          Check if a value satisfies the constraint.
 
Methods inherited from class com.codestreet.messageforge.RFldConstraintI8
isValid, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enums_

protected byte[] enums_
Enumeration of allowed values.

Constructor Detail

RFldConstraintI8Enum

public RFldConstraintI8Enum(java.lang.String fldName,
                            byte[] enums)
                     throws FieldValidationException
Constructor.

Parameters:
fldName - Name of field to which this constraint is bound.
enums - Enumeration of allowed values.

RFldConstraintI8Enum

public RFldConstraintI8Enum(java.lang.String fldName,
                            java.lang.String[] enums)
                     throws FieldValidationException
Constructor.

Parameters:
fldName - Name of field to which this constraint is bound.
enums - Enumeration of allowed values.
Method Detail

errDesc

public java.lang.String errDesc(java.lang.String fldName)
Get error description.

Specified by:
errDesc in interface RFldConstraint
Specified by:
errDesc in class RFldConstraintI8
Parameters:
fldName - Field name.
Returns:
Error description.

isValid

public boolean isValid(byte val)
Check if a value satisfies the constraint.

Specified by:
isValid in class RFldConstraintI8
Parameters:
val - Value.
Returns:
true if the field satisfied the constraint. Otherwise, false is returned.
See Also:
RFld


Copyright © 2003-2006 CodeStreet. All Rights Reserved.