protected final void checkIntegrity ( ) throws InternetSCSIException { String exceptionMessage = "" ; switch ( t ) { case OUI_FORMAT : break ; case IANA_ENTERPRISE_NUMBER : break ; case RANDOM : // if (d != 0) { // exceptionMessage = "The D field is reserved in this ISID Format."; // } break ; case RESERVED : if ( a != 0 && b != 0 && c != 0 && d != 0 ) { exceptionMessage = "This ISID is not valid. All" ; } break ; default : exceptionMessage = "This format is not supported." ; } if ( exceptionMessage . length ( ) > 0 ) { throw new InternetSCSIException ( exceptionMessage ) ; } else { // no error occured... Nice! :-) } }
This method checks if all fields are valid . In these cases an exception will be thrown .