目录

CLASS info
public final class PassObject.Builder
以Builder方式对PassObject进行赋值。

Public Method Summary

Return typeMethod name
PassObject.Builder

setPassTypeIdentifier(String passTypeIdentifier)

设置当前卡劵的类型。

PassObject.Builder

setCurrencyCode(String currencyCode)

设置当前卡劵的货币类型。

PassObject.Builder

addUrlList(Collection<AppendField> urlList)

添加Url信息。

PassObject.Builder

setPassStyleIdentifier(String passStyleIdentifier)

设置卡劵样式类型。

PassObject.Builder

setOrganizationPassId(String organizationPassId)

发行机构对卡的唯一标识,可以是卡号也可以是其他的标记,属于必须填写字段。

PassObject.Builder

setSerialNumber(String serialNumber)

当前发卡方唯一序列号。

PassObject.Builder

setStatus(PassStatus status)

设置当前状态。

PassObject.Builder

addRelatedPassIds(Collection<RelatedPassInfo> relatedPassIds)

会员卡相关优惠券id列表。

PassObject.BuilderaddLocationList(Collection<Location> locationList)
PassObject.BuildersetBarCode(BarCode barCode)
PassObject.Builder

addCommonFields(<Collection> commonFields)

添加commonField信息。

PassObject.Builder

addAppendFields(Collection<CommonField> appendFieldList)

添加addAppendField信息。

PassObject.Builder

addMessageList(Collection<AppendField> messageList)

添加消息列表。

PassObject.Builder

addImageList(Collection<AppendField> imageList)

添加广告轮播图片。

PassObject.Builder

addTextList(Collection<AppendField> textList)

添加文本信息。

PassObject

build()

获取当前赋值后的PassObject实例。

Public Method

Method
public PassObject.Builder setPassTypeIdentifier(String passTypeIdentifier)
设置当前卡劵的类型,passTypeIdentifier是区分其他卡劵的标识,属于必须填写字段。参考开发指南.注册该passTypeIdentifier。涉及的卡劵:会员卡:必填字段礼品卡:必填字段优惠券:必填字段

Parameters

Typedesc
String卡劵类型。
Method


public PassObject.Builder setCurrencyCode(String currencyCode)

设置当前卡劵的货币类型。涉及的卡劵:会员卡:非必填字段礼品卡:非必填字段优惠券:非必填字段

Parameters

Typedesc
String货币类型。
Method


public PassObject.Builder addUrlList(Collection<AppendField> urlList)

添加Url列表信息。涉及的卡劵:会员卡: 非必填字段礼品卡: 非必填字段优惠券: 非必填字段

Parameters

Typedesc
Collection<AppendField>Url列表信息。
Method


public PassObject.Builder setPassStyleIdentifier(String passStyleIdentifier)

设置当前卡劵的样式,当前卡劵可能是会员卡,礼品卡,优惠券,该字段是用于区分当前的不同功能型卡劵。属于必须填写字段。参考开发指南.注册该passStyleIdentifier。涉及的卡劵:会员卡:必填字段礼品卡:必填字段优惠券:必填字段

Parameters

Typedesc
String卡劵样式。
Method


public PassObject.Builder setOrganizationPassId(String organizationPassId)

发行机构对卡的唯一标识,可以是卡号也可以是其他的标记。属于必须填写字段。涉及的卡劵:会员卡:必填字段礼品卡:必填字段优惠券:必填字段

Parameters

Typedesc
String卡劵id。
Method


public PassObject.Builder setSerialNumber(String serialNumber)

当前发卡方唯一序列号。主要与钱包服务器有唯一对应。可以与organizationPassId保持一致。属于必须填写字段。涉及的卡劵:会员卡:必填字段礼品卡:必填字段优惠券:必填字段

Parameters

Typedesc
String当前卡片序列号。
Method


public Builder setStatus(PassStatus status)

设置当前卡劵的状态,具体赋值查看 PassStatus。属于必须填写字段。涉及的卡劵:会员卡:必填字段礼品卡:必填字段优惠券:必填字段

Parameters

Typedesc
PassStatus当前卡片状态。
Method


public PassObject.Builder addRelatedPassIds(Collection<RelatedPassInfo> relatedPassIds)

设置当前会员卡的优惠券的id列表。属于选填填写字段。涉及的卡劵:会员卡:选填字段

Parameters

Typedesc
Collection<RelatedPassInfo>当前卡片关联的优惠券id列表。
Method


public PassObject.Builder addLocationList(Collection<Location> locationList)

设置当前卡劵的位置信息,目前支持5组。属于选填填写字段。涉及的卡劵:会员卡:选填字段礼品卡:选填字段优惠券:选填字段

Parameters

Typedesc
Collection<Location>当前卡片位置信息。
Method


public PassObject.Builder setBarCode(BarCode barCode)

设置当前卡劵的条形码对象。属于选填填写字段。涉及的卡劵:会员卡:选填字段礼品卡:选填字段优惠券:选填字段

Parameters

Typedesc
BarCode当前卡片条形码对象。
Method


public PassObject.Builder addCommonFields(Collection<CommonField> commonFields)

添加commonField信息,例如:

    CommonField logoField = CommonField.getBuilder()  

                      .setKey(WalletPassConstant. PASS_COMMON_FIELD_KEY_LOGO)  

                      .setLabel(“Logo on the card”)   

                      .setValue(“https://xxx.jpg“)  

                      .build();

ArrayList commonFields = new ArrayList();

commonFields.add(logoField);

不同卡劵的commonField信息请到开发指南中查看。

Parameters

Typedesc
Collection<CommonField>CommonField列表。
Method


public PassObject.Builder addAppendFields(Collection< AppendField > AppendFields)

添加AppendField信息,例如: 

   AppendField logoField = AppendField.getBuilder() 

                       .setKey(WalletPassConstant. PASS_APPEND_FIELD_KEY_MAINPAGE) 

                       .setLabel(“key of the main page value in append fields “) 

                       .setValue(“https://xxx.com“)  

                      .build();

ArrayList AppendFields = new ArrayList()

;AppendFields.add(logoField);

不同卡劵的AppendFields信息请到开发指南中查看。

Parameters

Typedesc
Collection< AppendField >AppendField列表。
Method


public Builder addMessageList(Collection<AppendField> messageList)

设置当前卡劵的消息。涉及的卡劵:

会员卡:选填字段

礼品卡:选填字段

优惠券:选填字段

Parameters

Typedesc
Collection< AppendField >当前卡片消息列表。
Method


public PassObject.Builder addImageList(Collection<AppendField> imageList)

设置当前卡劵的轮播图片。涉及的卡劵:

会员卡:选填字段

礼品卡:选填字段

优惠券:选填字段


Parameters

Typedesc
Collection<AppendField>当前卡劵的轮播图片。
Method


public PassObject.Builder addTextList(Collection<AppendField> textList)

设置当前卡劵的文本信息。涉及的卡劵:会员卡:选填字段礼品卡:选填字段优惠券:选填字段

Parameters

Typedesc
Collection<AppendField>当前卡劵的文本信息。
Method


public PassObject build()

获取当前赋值后的PassObject实例。

Return

Typedesc
PassObjectPassObject实例。