Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.creditcloud.payment.model.chinapnr; import com.creditcloud.payment.model.PnRConstant; import com.creditcloud.payment.model.chinapnr.constraint.PnRReturnURL; import com.creditcloud.payment.model.chinapnr.enums.CmdIdType; import com.creditcloud.payment.model.chinapnr.base.BaseRequest; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import org.apache.commons.lang3.StringUtils; /** * * @author sobranie */ public class UserBindCardRequest extends BaseRequest { @NotNull @Size(max = 16) private String UsrCustId; @NotNull @PnRReturnURL @Size(max = 128) private String BgRetUrl; public UserBindCardRequest() { } public UserBindCardRequest(String MerCustId, String UsrCustId, String BgRetUrl) { super(PnRConstant.Version, CmdIdType.UserBindCard, MerCustId); this.UsrCustId = UsrCustId; this.BgRetUrl = BgRetUrl; } @Override public String chkString() { StringBuilder sb = new StringBuilder(baseChkString()); sb.append(StringUtils.trimToEmpty(getUsrCustId())).append(StringUtils.trimToEmpty(getBgRetUrl())) .append(StringUtils.trimToEmpty(getMerPriv())); return sb.toString(); } public String getUsrCustId() { return UsrCustId; } public void setUsrCustId(String UsrCustId) { this.UsrCustId = UsrCustId; } public String getBgRetUrl() { return BgRetUrl; } public void setBgRetUrl(String BgRetUrl) { this.BgRetUrl = BgRetUrl; } }