Skip to content

Commit

Permalink
Merge pull request #136 from anyspa/feature/Javadoc-fix
Browse files Browse the repository at this point in the history
fix javadoc
  • Loading branch information
chenhaozx committed Jun 4, 2019
2 parents 903d090 + 401579b commit 1893187
Show file tree
Hide file tree
Showing 25 changed files with 83 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/webank/weid/annoation/BlockChainDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* object or list.
*
* @return
* @return type Enum
*/
public BindTypeEnum bindType();

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/webank/weid/annoation/IndexField.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@

/**
* the file name.
* @return
* @return name
*/
String name() default "";

/**
* convert null to ''.
* @return
*/
* @return ''
*/
String nullAs() default "";

/**
* start from 0.
* @return index
*/
int index();
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static enum CredentialProofType {

/**
* Getter.
* @return typeName
*/
public String getTypeName() {
return typeName;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/webank/weid/constant/ErrorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ protected void setCodeDesc(String codeDesc) {
* get ErrorType By errcode.
*
* @param errorCode the ErrorCode
* @return errorCode
*/
public static ErrorCode getTypeByErrorCode(int errorCode) {
for (ErrorCode type : ErrorCode.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ public Map<String, Object> getSalt() {

/**
* put the salt into proof.
*
* @param salt map of salt
*/
public void setSalt(Map<String, Object> salt) {
putProofValue(ParamKeyConstant.PROOF_SALT, salt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class PresentationE implements RawSerializer, IProof {

/**
* 获取公钥Id,用于验证的时候识别publicKey.
* @return
* @return publicKeyId
*/
public String getVerificationMethod() {
return getValueFromProof(proof, ParamKeyConstant.PROOF_VERIFICATION_METHOD).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public ResponseData(T result, ErrorCode errorCode) {
*
* @param result the result
* @param errorCode the return code
* @param transactionInfo transactionInfo
*/
public ResponseData(T result, ErrorCode errorCode, TransactionInfo transactionInfo) {
this.result = result;
Expand All @@ -93,6 +94,8 @@ public ResponseData(T result, ErrorCode errorCode, TransactionInfo transactionIn

/**
* set a ErrorCode type errorCode.
*
* @param errorCode the errorCode
*/
public void setErrorCode(ErrorCode errorCode) {
if (errorCode != null) {
Expand All @@ -103,6 +106,10 @@ public void setErrorCode(ErrorCode errorCode) {

/**
* Instantiates a new Response data based on the error code and error message.
*
* @param result the result
* @param errorCode code number
* @param errorMessage errorMessage
*/
public ResponseData(T result, Integer errorCode, String errorMessage) {
this.result = result;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/webank/weid/rpc/CptService.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public interface CptService {
* Update the data fields of a registered CPT.
*
* @param args the args
* @param cptId the cpt id
* @return The updated CPT info
*/
ResponseData<CptBaseInfo> updateCpt(CptMapArgs args, Integer cptId);
Expand All @@ -86,6 +87,7 @@ public interface CptService {
* Update the data fields of a registered CPT.
*
* @param args the args
* @param cptId the cpt id
* @return The updated CPT info
*/
ResponseData<CptBaseInfo> updateCpt(CptStringArgs args, Integer cptId);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/webank/weid/rpc/CredentialPojoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ ResponseData<CredentialPojo> createSelectiveCredential(
/**
* Verify the validity of a credential. Public key will be fetched from chain.
*
* @param issuerWeId the issuer WeId
* @param credential the credential
* @return the verification result. True if yes, false otherwise with exact verify error codes
*/
Expand Down Expand Up @@ -89,7 +90,7 @@ ResponseData<Boolean> verify(
* @param presentationPolicyE the disclosure strategies.
* @param challenge used for authentication
* @param weIdAuthentication owner information
* @return
* @return PresentationE presentationE
*/
public ResponseData<PresentationE> createPresentation(
List<CredentialPojo> credentialList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface PushNotifyAllCallback {
* 链上链下health check, 不需要覆盖实现.
*
* @param arg echo arg
* @return
* @return amopNotifyMsgResult
*/
AmopNotifyMsgResult onPush(CheckAmopMsgHealthArgs arg);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public PresentationPolicyService() {
/**
* 获取PolicyAndChallenge.
* @param policyId 策略编号
* @param targetUserWeId user WeId
* @return 返回PresentationPolicyE对象数据
*/
public abstract PolicyAndChallenge policyAndChallengeOnPush(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public interface Persistence {
/**
* save data to storage.
*
* @param domain the domain of the data.
* @param id the key of the data.
* @param data which you want to store to the storage.
* @return execute status of the "save" operation.
Expand All @@ -42,6 +43,7 @@ public interface Persistence {
/**
* batch save data to storage.
*
* @param domain the domain of the data.
* @param ids list of keys
* @param dataList list of data
* @return execute status of the "save" operation.
Expand All @@ -51,6 +53,7 @@ public interface Persistence {
/**
* query data from storage by id.
*
* @param domain the domain of the data.
* @param id the key of the data.
* @return the data you stored.
*/
Expand All @@ -59,13 +62,16 @@ public interface Persistence {
/**
* delete data by id.
*
* @param domain the domain of the data.
* @param id the key of the data.
* @return the data you stored.
*/
public ResponseData<Integer> delete(String domain, String id);

/**
* update data by id.
*
* @param domain the domain of the data.
* @param id the key you store with.
* @param data the data you want to update into.
* @return execute status of the "update" operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public interface JsonTransportation {
/**
* 协议传输序列化接口.
* @param object 协议存储的实体数据对象
* @param <T> the type of the element
* @param property 协议的配置对象
* @return 返回协议字符串数据
*/
Expand All @@ -49,6 +50,7 @@ <T extends JsonSerializer> ResponseData<String> serialize(
* 协议反序列化接口.
* @param transString JSON格式的协议数据字符串
* @param clazz 需要转换成的Class类型
* @param <T> the type of the element
* @return 返回PresentationE对象数据
*/
<T extends JsonSerializer> ResponseData<T> deserialize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public String toString() {
/**
* get EncodeType by code.
* @param value code value
* @return
* @return codeType
*/
public static EncodeType getObject(String value) {
for (EncodeType codeType : EncodeType.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ public interface EncodeProcessor {
/**
* 编码处理方法定义.
* @param encodeData 需要编码的实体数据
* @value 返回编码后的数据
* @return 返回编码后的数据
* @throws EncodeSuiteException Exception
*/
public String encode(EncodeData encodeData) throws EncodeSuiteException;

/**
* 解码处理方法定义.
* @param encodeData 需要解码的实体数据
* @value 返回解密后的数据
* @return 返回解密后的数据
* @throws EncodeSuiteException Exception
*/
public String decode(EncodeData encodeData) throws EncodeSuiteException;
}
1 change: 1 addition & 0 deletions src/main/java/com/webank/weid/suite/entity/EncodeData.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class EncodeData {
* @param orgId 协议所属机构
* @param id 数据编号
* @param data 需要编解码数据
* @param verifiers 协议数据指定用户
*/
public EncodeData(String id, String orgId, String data, List<String> verifiers) {
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public int getCode() {
* get JsonVersion By code.
*
* @param code the JsonVersion
* @return JsonVersion
*/
public static JsonVersion getJsonVersion(int code) {
for (JsonVersion version : JsonVersion.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public String toString() {
/**
* get MetaVersion by code.
* @param value code value
* @return
* @return QrCodeVersion
*/
public static QrCodeVersion getObject(String value) {
for (QrCodeVersion version : QrCodeVersion.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public abstract class AbstractJsonTransportation

/**
* 验证协议配置.
* @param protocolProperty 协议配置实体
* @param encodeProperty 协议配置实体
* @return Error Code and Message
*/
protected ErrorCode checkEncodeProperty(ProtocolProperty encodeProperty) {
if (encodeProperty == null) {
Expand All @@ -53,7 +54,8 @@ protected ErrorCode checkEncodeProperty(ProtocolProperty encodeProperty) {

/**
* 验证wrapper数据.
* @param wrapper wrapper数据,作为协议的rawData部分
* @param obj wrapper数据,作为协议的rawData部分
* @return Error Code and Message
*/
protected ErrorCode checkProtocolData(Object obj) {
if (obj == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public String getExtendData() {

/**
* get TransString of Meta.
* @return
* @return transString of Meta
*/
public String getTransString() {
return this.buffer.toString();
Expand Down Expand Up @@ -127,7 +127,7 @@ protected void buildHead(EncodeType encodeType, QrCodeVersion version) {

/**
* 序列化协议对象.
* @param protocol 协议模板字符串
* @param protocols 协议模板字符串
*/
protected void buildBuffer(String[] protocols) {
buffer.setLength(0);
Expand Down Expand Up @@ -168,7 +168,7 @@ protected void buildBuffer(String[] protocols) {

/**
* 根据协议字符串数据构建协议对象数据.
* @param protocol 协议模板字符串
* @param protocols 协议模板字符串
* @param transString 协议字符串数据
*/
protected void buildData(String[] protocols, String transString) {
Expand Down Expand Up @@ -213,7 +213,7 @@ protected void buildData(String[] protocols, String transString) {
* 获取对应字段的get方法.
* @param cls 类型名
* @param fieldName 字段名
* @return
* @return Method
*/
private Method getGetterMethod(Class<?> cls, String fieldName) throws NoSuchMethodException {
return cls.getMethod("get"
Expand Down Expand Up @@ -242,16 +242,17 @@ private Method getSetterMethod(
/**
* build Meta instance by Class.
* @param cls class Type
* @return
* @return Object of QrCodeBaseData
*/
public static QrCodeBaseData newInstance(Class<?> cls) throws ReflectiveOperationException {
return (QrCodeBaseData)cls.newInstance();
}

/**
* get the MetaVersion by transString.
*
* @param transString this is transString
* @return
* @return Object of QrCodeVersion
*/
public static QrCodeVersion getQrCodeVersion(String transString) {
if (StringUtils.isBlank(transString) || transString.indexOf(PROTOCOL_PARTITION) == -1) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/webank/weid/util/CredentialPojoUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public final class CredentialPojoUtils {
* support selective disclosure; 3. Use compact output to avoid Json format confusion.
*
* @param credential target Credential object
* @param salt Salt Map
* @param disclosures Disclosure Map
* @return Hash value in String.
*/
public static String getCredentialThumbprintWithoutSig(
Expand All @@ -79,6 +81,8 @@ public static String getCredentialThumbprintWithoutSig(
* Credential Evidence. Return null if credential format is illegal.
*
* @param credential target Credential object
* @param salt Salt Map
* @param disclosures Disclosure Map
* @return Hash value in String.
*/
public static String getCredentialThumbprint(
Expand All @@ -101,6 +105,7 @@ public static String getCredentialThumbprint(
* Get the claim hash. This is irrelevant to selective disclosure.
*
* @param credential Credential
* @param salt Salt Map
* @param disclosures Disclosure Map
* @return the unique claim hash value
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/webank/weid/util/CredentialUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public final class CredentialUtils {
* without any extra space or linebreaks, to avoid different Json format beautification.
*
* @param credential target Credential object
* @param disclosures disclosures of the credential
* @return Hash value in String.
*/
public static String getCredentialThumbprintWithoutSig(
Expand Down

0 comments on commit 1893187

Please sign in to comment.