2013-11-04 64 views
8

我想將屬性從一個bean複製到另一個。這裏有兩個豆的簽名:如何使用BeanUtils.copyProperties?

SearchContent

public class SearchContent implements Serializable { 

    private static final long serialVersionUID = -4500094586165758427L; 

    private Integer id; 
    private String docName; 
    private String docType; 
    private String docTitle; 
    private String docAuthor; 
    private String securityGroup; 
    private String docAccount; 
    private Integer revLabel; 

    private String profile; 
    private LabelValueBean<String> workflowStage; 

    private Date createDate; 
    private Date inDate; 

    private String originalName; 
    private String format; 
    private String extension; 
    private Long fileSize; 

    private String author; 

    private LabelValueBean<String> entity; 
    private LabelValueBean<String> brand; 
    private LabelValueBean<String> product; 
    private LabelValueBean<String> collection; 
    private LabelValueBean<String> subCollection; 

    private String description; 
    private LabelValueBean<String> program; 
    private String vintage; 
    private String model; 
    private String restrictedZone; 
    private LabelValueBean<String> event; 
    private LabelValueBean<String> language; 
    private String geographicLocation; 
    private String watermark; 
    private Integer pageNumber; 
    private String summary; 
    private String agentName; 
    private String commissionedByName; 
    private String commissionedByDepartment; 
    private LabelValueBean<Integer> bestOf; 
    private String mediaLocation; 

    private LabelValueBean<Integer> fullRights; 
    private LabelValueBean<String> mediaUsage; 
    private Date rightsEndDate; 
    private String geographicRights; 
    private LabelValueBean<Integer> evinConformity; 
    private String contactReference; 
    private LabelValueBean<String> publicationScope; 
    private String rightsComment; 

    /** 
    * Constructor SearchContent 
    * @author TapasB 
    * @since 15-Oct-2013 - 5:45:55 pm 
    * @version DAM 1.0 
    */ 
    public SearchContent() { 

    } 

    public Integer getId() { 
     return id; 
    } 

    public void setId(Integer id) { 
     this.id = id; 
    } 

    public String getDocName() { 
     return docName; 
    } 

    public void setDocName(String docName) { 
     this.docName = docName; 
    } 

    public String getDocType() { 
     return docType; 
    } 

    public void setDocType(String docType) { 
     this.docType = docType; 
    } 

    public String getDocTitle() { 
     return docTitle; 
    } 

    public void setDocTitle(String docTitle) { 
     this.docTitle = docTitle; 
    } 

    public String getDocAuthor() { 
     return docAuthor; 
    } 

    public void setDocAuthor(String docAuthor) { 
     this.docAuthor = docAuthor; 
    } 

    public String getSecurityGroup() { 
     return securityGroup; 
    } 

    public void setSecurityGroup(String securityGroup) { 
     this.securityGroup = securityGroup; 
    } 

    public String getDocAccount() { 
     return docAccount; 
    } 

    public void setDocAccount(String docAccount) { 
     this.docAccount = docAccount; 
    } 

    public Integer getRevLabel() { 
     return revLabel; 
    } 

    public void setRevLabel(Integer revLabel) { 
     this.revLabel = revLabel; 
    } 

    public String getProfile() { 
     return profile; 
    } 

    public void setProfile(String profile) { 
     this.profile = profile; 
    } 

    public LabelValueBean<String> getWorkflowStage() { 
     return workflowStage; 
    } 

    public void setWorkflowStage(LabelValueBean<String> workflowStage) { 
     this.workflowStage = workflowStage; 
    } 

    public Date getCreateDate() { 
     return createDate; 
    } 

    public void setCreateDate(Date createDate) { 
     this.createDate = createDate; 
    } 

    public Date getInDate() { 
     return inDate; 
    } 

    public void setInDate(Date inDate) { 
     this.inDate = inDate; 
    } 

    public String getOriginalName() { 
     return originalName; 
    } 

    public void setOriginalName(String originalName) { 
     this.originalName = originalName; 
    } 

    public String getFormat() { 
     return format; 
    } 

    public void setFormat(String format) { 
     this.format = format; 
    } 

    public String getExtension() { 
     return extension; 
    } 

    public void setExtension(String extension) { 
     this.extension = extension; 
    } 

    public Long getFileSize() { 
     return fileSize; 
    } 

    public void setFileSize(Long fileSize) { 
     this.fileSize = fileSize; 
    } 

    public String getAuthor() { 
     return author; 
    } 

    public void setAuthor(String author) { 
     this.author = author; 
    } 

    public LabelValueBean<String> getEntity() { 
     return entity; 
    } 

    public void setEntity(LabelValueBean<String> entity) { 
     this.entity = entity; 
    } 

    public LabelValueBean<String> getBrand() { 
     return brand; 
    } 

    public void setBrand(LabelValueBean<String> brand) { 
     this.brand = brand; 
    } 

    public LabelValueBean<String> getProduct() { 
     return product; 
    } 

    public void setProduct(LabelValueBean<String> product) { 
     this.product = product; 
    } 

    public LabelValueBean<String> getCollection() { 
     return collection; 
    } 

    public void setCollection(LabelValueBean<String> collection) { 
     this.collection = collection; 
    } 

    public LabelValueBean<String> getSubCollection() { 
     return subCollection; 
    } 

    public void setSubCollection(LabelValueBean<String> subCollection) { 
     this.subCollection = subCollection; 
    } 

    public String getDescription() { 
     return description; 
    } 

    public void setDescription(String description) { 
     this.description = description; 
    } 

    public LabelValueBean<String> getProgram() { 
     return program; 
    } 

    public void setProgram(LabelValueBean<String> program) { 
     this.program = program; 
    } 

    public String getVintage() { 
     return vintage; 
    } 

    public void setVintage(String vintage) { 
     this.vintage = vintage; 
    } 

    public String getModel() { 
     return model; 
    } 

    public void setModel(String model) { 
     this.model = model; 
    } 

    public String getRestrictedZone() { 
     return restrictedZone; 
    } 

    public void setRestrictedZone(String restrictedZone) { 
     this.restrictedZone = restrictedZone; 
    } 

    public LabelValueBean<String> getEvent() { 
     return event; 
    } 

    public void setEvent(LabelValueBean<String> event) { 
     this.event = event; 
    } 

    public LabelValueBean<String> getLanguage() { 
     return language; 
    } 

    public void setLanguage(LabelValueBean<String> language) { 
     this.language = language; 
    } 

    public String getGeographicLocation() { 
     return geographicLocation; 
    } 

    public void setGeographicLocation(String geographicLocation) { 
     this.geographicLocation = geographicLocation; 
    } 

    public String getWatermark() { 
     return watermark; 
    } 

    public void setWatermark(String watermark) { 
     this.watermark = watermark; 
    } 

    public Integer getPageNumber() { 
     return pageNumber; 
    } 

    public void setPageNumber(Integer pageNumber) { 
     this.pageNumber = pageNumber; 
    } 

    public String getSummary() { 
     return summary; 
    } 

    public void setSummary(String summary) { 
     this.summary = summary; 
    } 

    public String getAgentName() { 
     return agentName; 
    } 

    public void setAgentName(String agentName) { 
     this.agentName = agentName; 
    } 

    public String getCommissionedByName() { 
     return commissionedByName; 
    } 

    public void setCommissionedByName(String commissionedByName) { 
     this.commissionedByName = commissionedByName; 
    } 

    public String getCommissionedByDepartment() { 
     return commissionedByDepartment; 
    } 

    public void setCommissionedByDepartment(String commissionedByDepartment) { 
     this.commissionedByDepartment = commissionedByDepartment; 
    } 

    public LabelValueBean<Integer> getBestOf() { 
     return bestOf; 
    } 

    public void setBestOf(LabelValueBean<Integer> bestOf) { 
     this.bestOf = bestOf; 
    } 

    public String getMediaLocation() { 
     return mediaLocation; 
    } 

    public void setMediaLocation(String mediaLocation) { 
     this.mediaLocation = mediaLocation; 
    } 

    public LabelValueBean<Integer> getFullRights() { 
     return fullRights; 
    } 

    public void setFullRights(LabelValueBean<Integer> fullRights) { 
     this.fullRights = fullRights; 
    } 

    public LabelValueBean<String> getMediaUsage() { 
     return mediaUsage; 
    } 

    public void setMediaUsage(LabelValueBean<String> mediaUsage) { 
     this.mediaUsage = mediaUsage; 
    } 

    public Date getRightsEndDate() { 
     return rightsEndDate; 
    } 

    public void setRightsEndDate(Date rightsEndDate) { 
     this.rightsEndDate = rightsEndDate; 
    } 

    public String getGeographicRights() { 
     return geographicRights; 
    } 

    public void setGeographicRights(String geographicRights) { 
     this.geographicRights = geographicRights; 
    } 

    public LabelValueBean<Integer> getEvinConformity() { 
     return evinConformity; 
    } 

    public void setEvinConformity(LabelValueBean<Integer> evinConformity) { 
     this.evinConformity = evinConformity; 
    } 

    public String getContactReference() { 
     return contactReference; 
    } 

    public void setContactReference(String contactReference) { 
     this.contactReference = contactReference; 
    } 

    public LabelValueBean<String> getPublicationScope() { 
     return publicationScope; 
    } 

    public void setPublicationScope(LabelValueBean<String> publicationScope) { 
     this.publicationScope = publicationScope; 
    } 

    public String getRightsComment() { 
     return rightsComment; 
    } 

    public void setRightsComment(String rightsComment) { 
     this.rightsComment = rightsComment; 
    } 
} 

而且Content

public class Content implements Serializable { 

    private static final long serialVersionUID = 2999449587418137835L; 

    private Boolean selected; 
    private Boolean renditionInfoFetched; 

    private String searchPageImageRendition; 
    private String detailPageImageRendition; 

    private String videoRendition; 

    private Integer id; 
    private String docName; 
    private String docType; 
    private String docTitle; 
    private String docAuthor; 
    private String securityGroup; 
    private String docAccount; 
    private Integer revLabel; 
    private String profile; 

    private Date createDate; 
    private Date inDate; 

    private String originalName; 
    private String format; 
    private String extension; 
    private Long fileSize; 

    private String author; 

    private LabelValueBean<String> entity; 
    private LabelValueBean<String> brand; 
    private LabelValueBean<String> product; 
    private LabelValueBean<String> collection; 
    private LabelValueBean<String> subCollection; 

    private String description; 
    private LabelValueBean<String> program; 
    private String vintage; 
    private String model; 
    private String restrictedZone; 
    private LabelValueBean<String> event; 
    private LabelValueBean<String> language; 
    private String geographicLocation; 
    private String watermark; 
    private Integer pageNumber; 
    private String summary; 
    private String agentName; 
    private String commissionedByName; 
    private String commissionedByDepartment; 
    private LabelValueBean<Integer> bestOf; 
    private String mediaLocation; 

    private LabelValueBean<Integer> fullRights; 
    private LabelValueBean<String> mediaUsage; 
    private Date rightsEndDate; 
    private String geographicRights; 
    private LabelValueBean<Integer> evinConformity; 
    private String contactReference; 
    private LabelValueBean<String> publicationScope; 
    private String rightsComment; 

    public Boolean getSelected() { 
     return selected; 
    } 

    public void setSelected(Boolean selected) { 
     this.selected = selected; 
    } 

    public Boolean getRenditionInfoFetched() { 
     return renditionInfoFetched; 
    } 

    public void setRenditionInfoFetched(Boolean renditionInfoFetched) { 
     this.renditionInfoFetched = renditionInfoFetched; 
    } 

    public String getSearchPageImageRendition() { 
     return searchPageImageRendition; 
    } 

    public void setSearchPageImageRendition(String searchPageImageRendition) { 
     this.searchPageImageRendition = searchPageImageRendition; 
    } 

    public String getDetailPageImageRendition() { 
     return detailPageImageRendition; 
    } 

    public void setDetailPageImageRendition(String detailPageImageRendition) { 
     this.detailPageImageRendition = detailPageImageRendition; 
    } 

    public String getVideoRendition() { 
     return videoRendition; 
    } 

    public void setVideoRendition(String videoRendition) { 
     this.videoRendition = videoRendition; 
    } 

    public Integer getId() { 
     return id; 
    } 

    public void setId(Integer id) { 
     this.id = id; 
    } 

    public String getDocName() { 
     return docName; 
    } 

    public void setDocName(String docName) { 
     this.docName = docName; 
    } 

    public String getDocType() { 
     return docType; 
    } 

    public void setDocType(String docType) { 
     this.docType = docType; 
    } 

    public String getDocTitle() { 
     return docTitle; 
    } 

    public void setDocTitle(String docTitle) { 
     this.docTitle = docTitle; 
    } 

    public String getDocAuthor() { 
     return docAuthor; 
    } 

    public void setDocAuthor(String docAuthor) { 
     this.docAuthor = docAuthor; 
    } 

    public String getSecurityGroup() { 
     return securityGroup; 
    } 

    public void setSecurityGroup(String securityGroup) { 
     this.securityGroup = securityGroup; 
    } 

    public String getDocAccount() { 
     return docAccount; 
    } 

    public void setDocAccount(String docAccount) { 
     this.docAccount = docAccount; 
    } 

    public Integer getRevLabel() { 
     return revLabel; 
    } 

    public void setRevLabel(Integer revLabel) { 
     this.revLabel = revLabel; 
    } 

    public String getProfile() { 
     return profile; 
    } 

    public void setProfile(String profile) { 
     this.profile = profile; 
    } 

    public Date getCreateDate() { 
     return createDate; 
    } 

    public void setCreateDate(Date createDate) { 
     this.createDate = createDate; 
    } 

    public Date getInDate() { 
     return inDate; 
    } 

    public void setInDate(Date inDate) { 
     this.inDate = inDate; 
    } 

    public String getOriginalName() { 
     return originalName; 
    } 

    public void setOriginalName(String originalName) { 
     this.originalName = originalName; 
    } 

    public String getFormat() { 
     return format; 
    } 

    public void setFormat(String format) { 
     this.format = format; 
    } 

    public String getExtension() { 
     return extension; 
    } 

    public void setExtension(String extension) { 
     this.extension = extension; 
    } 

    public Long getFileSize() { 
     return fileSize; 
    } 

    public void setFileSize(Long fileSize) { 
     this.fileSize = fileSize; 
    } 

    public String getAuthor() { 
     return author; 
    } 

    public void setAuthor(String author) { 
     this.author = author; 
    } 

    public LabelValueBean<String> getEntity() { 
     return entity; 
    } 

    public void setEntity(LabelValueBean<String> entity) { 
     this.entity = entity; 
    } 

    public LabelValueBean<String> getBrand() { 
     return brand; 
    } 

    public void setBrand(LabelValueBean<String> brand) { 
     this.brand = brand; 
    } 

    public LabelValueBean<String> getProduct() { 
     return product; 
    } 

    public void setProduct(LabelValueBean<String> product) { 
     this.product = product; 
    } 

    public LabelValueBean<String> getCollection() { 
     return collection; 
    } 

    public void setCollection(LabelValueBean<String> collection) { 
     this.collection = collection; 
    } 

    public LabelValueBean<String> getSubCollection() { 
     return subCollection; 
    } 

    public void setSubCollection(LabelValueBean<String> subCollection) { 
     this.subCollection = subCollection; 
    } 

    public String getDescription() { 
     return description; 
    } 

    public void setDescription(String description) { 
     this.description = description; 
    } 

    public LabelValueBean<String> getProgram() { 
     return program; 
    } 

    public void setProgram(LabelValueBean<String> program) { 
     this.program = program; 
    } 

    public String getVintage() { 
     return vintage; 
    } 

    public void setVintage(String vintage) { 
     this.vintage = vintage; 
    } 

    public String getModel() { 
     return model; 
    } 

    public void setModel(String model) { 
     this.model = model; 
    } 

    public String getRestrictedZone() { 
     return restrictedZone; 
    } 

    public void setRestrictedZone(String restrictedZone) { 
     this.restrictedZone = restrictedZone; 
    } 

    public LabelValueBean<String> getEvent() { 
     return event; 
    } 

    public void setEvent(LabelValueBean<String> event) { 
     this.event = event; 
    } 

    public LabelValueBean<String> getLanguage() { 
     return language; 
    } 

    public void setLanguage(LabelValueBean<String> language) { 
     this.language = language; 
    } 

    public String getGeographicLocation() { 
     return geographicLocation; 
    } 

    public void setGeographicLocation(String geographicLocation) { 
     this.geographicLocation = geographicLocation; 
    } 

    public String getWatermark() { 
     return watermark; 
    } 

    public void setWatermark(String watermark) { 
     this.watermark = watermark; 
    } 

    public Integer getPageNumber() { 
     return pageNumber; 
    } 

    public void setPageNumber(Integer pageNumber) { 
     this.pageNumber = pageNumber; 
    } 

    public String getSummary() { 
     return summary; 
    } 

    public void setSummary(String summary) { 
     this.summary = summary; 
    } 

    public String getAgentName() { 
     return agentName; 
    } 

    public void setAgentName(String agentName) { 
     this.agentName = agentName; 
    } 

    public String getCommissionedByName() { 
     return commissionedByName; 
    } 

    public void setCommissionedByName(String commissionedByName) { 
     this.commissionedByName = commissionedByName; 
    } 

    public String getCommissionedByDepartment() { 
     return commissionedByDepartment; 
    } 

    public void setCommissionedByDepartment(String commissionedByDepartment) { 
     this.commissionedByDepartment = commissionedByDepartment; 
    } 

    public LabelValueBean<Integer> getBestOf() { 
     return bestOf; 
    } 

    public void setBestOf(LabelValueBean<Integer> bestOf) { 
     this.bestOf = bestOf; 
    } 

    public String getMediaLocation() { 
     return mediaLocation; 
    } 

    public void setMediaLocation(String mediaLocation) { 
     this.mediaLocation = mediaLocation; 
    } 

    public LabelValueBean<Integer> getFullRights() { 
     return fullRights; 
    } 

    public void setFullRights(LabelValueBean<Integer> fullRights) { 
     this.fullRights = fullRights; 
    } 

    public LabelValueBean<String> getMediaUsage() { 
     return mediaUsage; 
    } 

    public void setMediaUsage(LabelValueBean<String> mediaUsage) { 
     this.mediaUsage = mediaUsage; 
    } 

    public Date getRightsEndDate() { 
     return rightsEndDate; 
    } 

    public void setRightsEndDate(Date rightsEndDate) { 
     this.rightsEndDate = rightsEndDate; 
    } 

    public String getGeographicRights() { 
     return geographicRights; 
    } 

    public void setGeographicRights(String geographicRights) { 
     this.geographicRights = geographicRights; 
    } 

    public LabelValueBean<Integer> getEvinConformity() { 
     return evinConformity; 
    } 

    public void setEvinConformity(LabelValueBean<Integer> evinConformity) { 
     this.evinConformity = evinConformity; 
    } 

    public String getContactReference() { 
     return contactReference; 
    } 

    public void setContactReference(String contactReference) { 
     this.contactReference = contactReference; 
    } 

    public LabelValueBean<String> getPublicationScope() { 
     return publicationScope; 
    } 

    public void setPublicationScope(LabelValueBean<String> publicationScope) { 
     this.publicationScope = publicationScope; 
    } 

    public String getRightsComment() { 
     return rightsComment; 
    } 

    public void setRightsComment(String rightsComment) { 
     this.rightsComment = rightsComment; 
    } 
} 

我想屬性複製從SearchContentContent爲:

Content content = new Content();   
Converter converter = new DateConverter(null); 
BeanUtilsBean beanUtilsBean = BeanUtilsBean.getInstance(); 
beanUtilsBean.getConvertUtils().register(converter, Date.class);   
BeanUtils.copyProperties(searchContent, content); 

System.out.println(searchContent); 
System.out.println(content); 

Sysout是打印:

com.mhis.dam.service.search.bean.SearchContent[id=52906,docName=MHIS043570,docType=Images,docTitle=preview_1_8,docAuthor=sysadmin,securityGroup=Internal,docAccount=WF/017/DAM/000,revLabel=1,profile=DAMMedia,workflowStage=com.mhis.dam.generic.bean.LabelValueBean[label=Published,value=published],createDate=Fri Oct 18 15:30:35 IST 2013,inDate=Fri Oct 18 15:30:35 IST 2013,originalName=Vintage 2004 Gift Box & Bottle Black - hires.jpg,format=image/jpeg,extension=jpg,fileSize=2106898,author=Arjan,entity=com.mhis.dam.generic.bean.LabelValueBean[label=Dom Perignon,value=WF/017/DAM],brand=com.mhis.dam.generic.bean.LabelValueBean[label=Dom Perignon,value=WF/017/DAM/001],product=com.mhis.dam.generic.bean.LabelValueBean[label=Blanc,value=17_1_blanc],collection=com.mhis.dam.generic.bean.LabelValueBean[label=Pack shot,value=pack_shot_dp],subCollection=com.mhis.dam.generic.bean.LabelValueBean[label=Bottle shot,value=ps_bottle_dp],description=preview_1,program=com.mhis.dam.generic.bean.LabelValueBean[label=<null>,value=],vintage=,model=,restrictedZone=,event=com.mhis.dam.generic.bean.LabelValueBean[label=<null>,value=],language=com.mhis.dam.generic.bean.LabelValueBean[label=<null>,value=],geographicLocation=,watermark=,pageNumber=0,summary=,agentName=,commissionedByName=Nicolas,commissionedByDepartment=,bestOf=com.mhis.dam.generic.bean.LabelValueBean[label=<null>,value=0],mediaLocation=,fullRights=com.mhis.dam.generic.bean.LabelValueBean[label=<null>,value=1],mediaUsage=com.mhis.dam.generic.bean.LabelValueBean[label=<null>,value=],rightsEndDate=<null>,geographicRights=,evinConformity=com.mhis.dam.generic.bean.LabelValueBean[label=<null>,value=2],contactReference=,publicationScope=com.mhis.dam.generic.bean.LabelValueBean[label=Full public usage,value=fullPublic],rightsComment=] 
com.mhis.dam.web.model.Content[selected=<null>,renditionInfoFetched=<null>,searchPageImageRendition=<null>,detailPageImageRendition=<null>,videoRendition=<null>,id=<null>,docName=<null>,docType=<null>,docTitle=<null>,docAuthor=<null>,securityGroup=<null>,docAccount=<null>,revLabel=<null>,profile=<null>,createDate=<null>,inDate=<null>,originalName=<null>,format=<null>,extension=<null>,fileSize=<null>,author=<null>,entity=<null>,brand=<null>,product=<null>,collection=<null>,subCollection=<null>,description=<null>,program=<null>,vintage=<null>,model=<null>,restrictedZone=<null>,event=<null>,language=<null>,geographicLocation=<null>,watermark=<null>,pageNumber=<null>,summary=<null>,agentName=<null>,commissionedByName=<null>,commissionedByDepartment=<null>,bestOf=<null>,mediaLocation=<null>,fullRights=<null>,mediaUsage=<null>,rightsEndDate=<null>,geographicRights=<null>,evinConformity=<null>,contactReference=<null>,publicationScope=<null>,rightsComment=<null>] 

很明顯,對於有selected和空值類ContentrenditionInfoFetched領域,因爲它們不存在於SearchContent但可以看到的Content的所有其他屬性一片空白。我無法找到我做錯了什麼!

任何指針都會非常有幫助。

+0

似乎param順序被顛倒。你最好使用beanUtilsBean。 copyProperties。 BeanUtils正在使用一個共享beanUtilsBean – farmer1992

+0

愚蠢的錯誤:( –

回答

20

如果你想從searchContent複製到內容,那麼代碼應該如下

BeanUtils.copyProperties(content, searchContent); 

你需要扭轉的參數如上在你的代碼。

從API,

公共靜態無效copyProperties(對象DEST, 對象原稿) 拋出IllegalAccessException, 的InvocationTargetException)

參數: DEST - 目的地豆,其屬性被修改 原稿 - 原產地豆其屬性被檢索

http://commons.apache.org/proper/commons-beanutils/apidocs/org/apache/commons/beanutils/BeanUtils.html#copyProperties(java.lang.Object,java.lang.Object)

+14

只是爲了理智的緣故... Apache和Spring都有一個帶有copyProperties方法的BeanUtils類,它們以相反的順序接受它們的參數Apache的BeanUtils.copyProperties(target,源代碼),Spring's是BeanUtils.copyProperties(源代碼,目標代碼) –

+0

爲Night Owl的評論添加內容您還可以跟蹤copyProperties的方法,它應該顯示參數順序,源代碼和目標代碼 這是春季,公開static void copyProperties(java.lang.Object source,java.lang.Object target) – JaredT

16

Java中有兩個BeanUtils.copyProperties(parameter1,parameter2)。

一個是

org.apache.commons.beanutils.BeanUtils.copyProperties(對象DEST, 對象原稿

另一個是

org.springframework .beans.BeanUtils.copyProperties(Object source, Object target

注重參數相反位置。