app/src/main/java/com/treslines/pagsegurodemo/PagSeguroPhone.java
private void validate(final String number){
        if(number.isEmpty()){
            throw new IllegalArgumentException("Number can not be empty!");
        }
        if(number.length()<7 || number.length()>9){
            throw new IllegalArgumentException("Number can not contain less then 7 digits and not exceed 9!");
        }
        try{
            Double.valueOf(number);
        }catch(Exception e){
            throw new IllegalArgumentException("Number code must be composed of numbers only!");
        }
    }
/** validation defined acc. to pagseguro's web documentation */
validation defined acc. to pagseguro's web documentation
validation defined acc . to pagseguro ' s web documentation
private void validate(final String number){
        if(number.isEmpty()){
            throw new IllegalArgumentException("Number can not be empty!");
        }
        if(number.length()<7 || number.length()>9){
            throw new IllegalArgumentException("Number can not contain less then 7 digits and not exceed 9!");
        }
        try{
            Double.valueOf(number);
        }catch(Exception e){
            throw new IllegalArgumentException("Number code must be composed of numbers only!");
        }
    }
private void validate ( final String number ) { if ( number . isEmpty ( ) ) { throw new IllegalArgumentException ( "Number can not be empty!" ) ; } if ( number . length ( ) < 7 || number . length ( ) > 9 ) { throw new IllegalArgumentException ( "Number can not contain less then 7 digits and not exceed 9!" ) ; } try { Double . valueOf ( number ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Number code must be composed of numbers only!" ) ; } }
validation defined acc.
validation defined acc .