@Override @OverridingMethodsMustInvokeSuper public boolean isValidValue (@Nullable final String sValue) { return super.isValidValue (sValue) || StringParser.parseIntObj (sValue) != null; }
@Nonnull public IValidationResult validate (@Nullable final String sValue) { final Integer aValue = StringParser.parseIntObj (sValue); if (aValue == null) return new ValidationResultError (EStandardValidationErrorTexts.INVALID_INT); final int nValue = aValue.intValue (); if (m_nMinInclusive != Integer.MIN_VALUE && nValue < m_nMinInclusive) { return ValidationResultError.create (EStandardValidationErrorTexts.INVALID_INT_RANGE, Integer.toString (m_nMinInclusive), Integer.toString (m_nMaxInclusive)); } if (m_nMaxInclusive != Integer.MAX_VALUE && nValue > m_nMaxInclusive) { return ValidationResultError.create (EStandardValidationErrorTexts.INVALID_INT_RANGE, Integer.toString (m_nMinInclusive), Integer.toString (m_nMaxInclusive)); } return ValidationResultSuccess.getInstance (); }
@Nonnull public IValidationResult validate (@Nullable final String sValue) { final Integer aValue = StringParser.parseIntObj (sValue); if (aValue == null) return new ValidationResultError (EStandardValidationErrorTexts.INVALID_INT); final int nValue = aValue.intValue (); if (m_bZeroIsAllowed) { if (nValue < 0) return new ValidationResultError (EStandardValidationErrorTexts.INVALID_INT_UNSIGNED_INCL0); } else { if (nValue <= 0) return new ValidationResultError (EStandardValidationErrorTexts.INVALID_INT_UNSIGNED_EXCL0); } return ValidationResultSuccess.getInstance (); }