class SelectAddressPresenter extends BasePresenter<SelectAddressContract.View> implements SelectAddressContract.Presenter {

    @Override
    public void selectAddress(int position) {
        if (addressEntityList != null && addressEntityList.size() > position) {
            if (isViewAttached()) {
                String action = getView().getAction();
                Address addressEntity = addressEntityList.get(position);
                if (Constants.Action.ACTION_GET_ADDRESS.equals(action)) {
                    getView().setResult(addressEntity);
                } else {
                    CommonUtil.copyTextToClipboard(currentActivity(), addressEntity.getAddress());
                }
            }
        }
    }

}