public boolean validate( CheckResultSourceInterface source, String propertyName, List<CheckResultInterface> remarks, ValidatorContext context ) { String value = ValidatorUtils.getValueAsString( source, propertyName ); if ( GenericValidator.isBlankOrNull( value ) ) { JobEntryValidatorUtils.addFailureRemark( source, propertyName, VALIDATOR_NAME, remarks, JobEntryValidatorUtils.getLevelOnFail( context, VALIDATOR_NAME ) ); return false; } else { return true; } }
if (!GenericValidator.isBlankOrNull(extra)) { return false;
public boolean validate( CheckResultSourceInterface source, String propertyName, List<CheckResultInterface> remarks, ValidatorContext context ) { String value = null; value = ValidatorUtils.getValueAsString( source, propertyName ); if ( !GenericValidator.isBlankOrNull( value ) && !GenericValidator.isEmail( value ) ) { JobEntryValidatorUtils.addFailureRemark( source, propertyName, VALIDATOR_NAME, remarks, JobEntryValidatorUtils.getLevelOnFail( context, VALIDATOR_NAME ) ); return false; } else { return true; } }
public boolean validate( CheckResultSourceInterface source, String propertyName, List<CheckResultInterface> remarks, ValidatorContext context ) { Object result = null; String value = null; value = ValidatorUtils.getValueAsString( source, propertyName ); if ( GenericValidator.isBlankOrNull( value ) ) { return true; } result = GenericTypeValidator.formatInt( value ); if ( result == null ) { JobEntryValidatorUtils.addFailureRemark( source, propertyName, VALIDATOR_NAME, remarks, JobEntryValidatorUtils.getLevelOnFail( context, VALIDATOR_NAME ) ); return false; } return true; }
public boolean validate( CheckResultSourceInterface source, String propertyName, List<CheckResultInterface> remarks, ValidatorContext context ) { Object result = null; String value = null; value = ValidatorUtils.getValueAsString( source, propertyName ); if ( GenericValidator.isBlankOrNull( value ) ) { return Boolean.TRUE; } result = GenericTypeValidator.formatLong( value ); if ( result == null ) { JobEntryValidatorUtils.addFailureRemark( source, propertyName, VALIDATOR_NAME, remarks, JobEntryValidatorUtils.getLevelOnFail( context, VALIDATOR_NAME ) ); return false; } return true; }
/** * Checks if the field is required. * * @return boolean If the field isn't <code>null</code> and * has a length greater than zero, <code>true</code> is returned. * Otherwise <code>false</code>. */ public static boolean validateRequired(Object bean, Field field) { String value = ValidatorUtils.getValueAsString(bean, field.getProperty()); return !GenericValidator.isBlankOrNull(value); }
Long customerPhoneId, @RequestParam(required = false) Long phoneId) { if (GenericValidator.isBlankOrNull(phoneNameForm.getPhoneName())) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "phoneName", "phoneName.required");
if (!GenericValidator.isBlankOrNull(field.getVarValue("fieldJoin"))) { fieldJoin = field.getVarValue("fieldJoin"); required = true; while (!GenericValidator.isBlankOrNull(field.getVarValue("field[" + i + "]"))) { String dependProp = field.getVarValue("field[" + i + "]"); String dependTest = field.getVarValue("fieldTest[" + i + "]");
/** * Checks if the input field is null, and if the length of the field is greater than zero, excluding whitespace. */ public boolean isBlankOrNull(String input) { return GenericValidator.isBlankOrNull(input); }
private static boolean startsWithVoiceBlastPrefix(String str) { if (GenericValidator.isBlankOrNull(str)) { return false; } return str.startsWith(VOICE_BLAST_PREFIX); }
@Deprecated private static boolean startsWithConferencePrefix(String str) { if (GenericValidator.isBlankOrNull(str)) { return false; } return str.startsWith(CONFERENCE_ID_PREFIX); }
@Deprecated private static boolean startsWithMakeCallPrefix(String str) { if (GenericValidator.isBlankOrNull(str)) { return false; } return str.startsWith(MAKE_CALL_ID_PREFIX); }
@Deprecated private static boolean startsWithSecondPartyPrefix(String str) { if (GenericValidator.isBlankOrNull(str)) { return false; } return str.startsWith(SECOND_PARTY_ID_PREFIX); }
@Deprecated public static boolean isDialableNumber(String extn) { if (GenericValidator.isBlankOrNull(extn)) { return false; } if (StringUtils.isNumeric(extn)) { return true; } return false; }
MultipurposeCommandResponseIQ(String responseString, String extn, String callId, Map<String, String> keyNameMap) { this.str = responseString; if (!GenericValidator.isBlankOrNull(extn)) { this.setProperty("extn", extn); } if (!GenericValidator.isBlankOrNull(callId)) { this.setProperty("callId", callId); } this.keyNameMap = keyNameMap; }
public static boolean isValidOpenlinkLabel(String str) { if (GenericValidator.isBlankOrNull(str)) { return false; } return StringUtils.isAlphanumericSpace(str); }
/** * Checks if the field is required. * * @return boolean If the field isn't <code>null</code> and * has a length greater than zero, <code>true</code> is returned. * Otherwise <code>false</code>. */ public static boolean validateRequired(Object bean, Field field) { String value = ValidatorUtils.getValueAsString(bean, field.getProperty()); return !GenericValidator.isBlankOrNull(value); }
public static void addElementAndOptionalTextNode(Element call, String elementName, String text) { Util.validateNonNullObject(call); Util.validateNonNullObject(elementName); Util.validateNonNullObject(text); Element newElement = call.addElement(elementName); if (!GenericValidator.isBlankOrNull(text)) { newElement.setText(text); } } }
public static void buildDeviceStatusDtmf(Element out, String profileId, String featureId, String callId, String digit, String direction, String participantExtn) { Element devicestatus = out.addElement("devicestatus", "http://xmpp.org/protocol/openlink:01:00:00#device-status"); if (!GenericValidator.isBlankOrNull(profileId)) { devicestatus.addElement("profile").setText(profileId); } Element features = devicestatus.addElement("features"); Element feature = features.addElement("feature").addAttribute("id", TelephonyPrefix.extractMessageKeyFromTimestampFilepath(featureId)); buildFeatureDtmf(feature, callId, digit, direction, participantExtn); }
public static void buildDeviceStatusMessage(Element out, String profileId, String featureId, String actionId, String state, String status, String statusDescriptor, String action, String msgLength, String exten, Collection<String> playlistKeys, String creationDate, String playProgress, String label, String blastId) { Element devicestatus = out.addElement("devicestatus", "http://xmpp.org/protocol/openlink:01:00:00#device-status"); if (GenericValidator.isBlankOrNull(profileId)) { devicestatus.addElement("profile"); } else { devicestatus.addElement("profile").setText(profileId); } Element features = devicestatus.addElement("features"); Element feature = features.addElement("feature").addAttribute("id", TelephonyPrefix.extractMessageKeyFromTimestampFilepath(featureId)); buildFeatureVoiceMessage(feature, actionId, state, status, statusDescriptor, action, msgLength, exten, playlistKeys, creationDate, playProgress, label, blastId); }