class AddNewAddressPresenter extends BasePresenter<AddNewAddressContract.View> implements AddNewAddressContract.Presenter {

    @Override
    public boolean checkAddressName(String name) {

        String errMsg = null;

        if (TextUtils.isEmpty(name.trim())) {
            errMsg = string(R.string.address_name_cannot_be_empty);
        } else {
            if (name.length() > 20) {
                errMsg = string(R.string.address_name_length_error);
            }
        }

        if (TextUtils.isEmpty(errMsg)) {
            getView().setNameVisibility(View.GONE);
        } else {
            getView().showNameError(errMsg);
        }

        return TextUtils.isEmpty(errMsg);
    }

}