Class PresentationExchangeRecord
- java.lang.Object
-
- org.hyperledger.aries.api.present_proof.BasePresExRecord
-
- org.hyperledger.aries.api.present_proof.PresentationExchangeRecord
-
- All Implemented Interfaces:
PresExStateTranslator
public class PresentationExchangeRecord extends BasePresExRecord
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPresentationExchangeRecord.Identifierstatic classPresentationExchangeRecord.PresentationExchangeRecordBuilder<C extends PresentationExchangeRecord,B extends PresentationExchangeRecord.PresentationExchangeRecordBuilder<C,B>>static classPresentationExchangeRecord.RevealedAttributestatic classPresentationExchangeRecord.RevealedAttributeGroup-
Nested classes/interfaces inherited from class org.hyperledger.aries.api.present_proof.BasePresExRecord
BasePresExRecord.BasePresExRecordBuilder<C extends BasePresExRecord,B extends BasePresExRecord.BasePresExRecordBuilder<C,B>>
-
-
Constructor Summary
Constructors Modifier Constructor Description PresentationExchangeRecord()PresentationExchangeRecord(com.google.gson.JsonObject presentationProposalDict, PresentProofRequest.ProofRequest presentationRequest, com.google.gson.JsonObject presentationRequestDict, com.google.gson.JsonObject presentation, List<PresentationExchangeRecord.Identifier> identifiers, ExchangeVersion version)protectedPresentationExchangeRecord(PresentationExchangeRecord.PresentationExchangeRecordBuilder<?,?> b)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PresentationExchangeRecord.PresentationExchangeRecordBuilder<?,?>builder()protected booleancanEqual(Object other)booleanequals(Object o)Map<String,PresentationExchangeRecord.RevealedAttribute>findRevealedAttributedFull()Low level extractor that returns a map of all revealed attributes with the all their information.Map<String,PresentationExchangeRecord.RevealedAttributeGroup>findRevealedAttributeGroups()Low level extractor that maps revealed attributes and values to their groupMap<String,Object>findRevealedAttributes()Low level extractor that returns a map of all revealed attributes and their values.<T> Tfrom(@NonNull Class<T> type)Sets the received presentation attributes on the instance.Map<String,Object>from(@NonNull Set<String> names)Finds the attribute names in the proof and extracts their corresponding values.List<PresentationExchangeRecord.Identifier>getIdentifiers()com.google.gson.JsonObjectgetPresentation()com.google.gson.JsonObjectgetPresentationProposalDict()PresentProofRequest.ProofRequestgetPresentationRequest()com.google.gson.JsonObjectgetPresentationRequestDict()ExchangeVersiongetVersion()booleanhasCredentialDefinitionId(@NonNull String credentialDefinitionId)inthashCode()booleanhasSchemaId(@NonNull String schemaId)voidsetIdentifiers(List<PresentationExchangeRecord.Identifier> identifiers)voidsetPresentation(com.google.gson.JsonObject presentation)voidsetPresentationProposalDict(com.google.gson.JsonObject presentationProposalDict)voidsetPresentationRequest(PresentProofRequest.ProofRequest presentationRequest)voidsetPresentationRequestDict(com.google.gson.JsonObject presentationRequestDict)voidsetVersion(ExchangeVersion version)StringtoString()-
Methods inherited from class org.hyperledger.aries.api.present_proof.BasePresExRecord
getAutoPresent, getAutoVerify, getConnectionId, getCreatedAt, getErrorMsg, getInitiator, getPresentationExchangeId, getPresExId, getRole, getState, getThreadId, getTrace, getUpdatedAt, getVerified, initiatorIsExternal, initiatorIsSelf, isVerified, setAutoPresent, setAutoVerify, setConnectionId, setCreatedAt, setErrorMsg, setInitiator, setPresentationExchangeId, setRole, setState, setThreadId, setTrace, setUpdatedAt, setVerified, versionIsV1
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hyperledger.aries.api.present_proof.PresExStateTranslator
roleIsProver, roleIsProverAndPresentationAcked, roleIsProverAndPresentationSent, roleIsProverAndProposalSent, roleIsProverAndRequestReceived, roleIsProverAndStateIsPresentationAckedOrDone, roleIsVerifier, roleIsVerifierAndDone, roleIsVerifierAndRequestSent, roleIsVerifierAndStateIsVerifiedOrDone, roleIsVerifierAndVerified, stateIsAbandoned, stateIsDone, stateIsPresentationAcked, stateIsPresentationReceived, stateIsPresentationSent, stateIsProposalReceived, stateIsProposalSent, stateIsRequestReceived, stateIsRequestSent, stateIsVerified
-
-
-
-
Constructor Detail
-
PresentationExchangeRecord
protected PresentationExchangeRecord(PresentationExchangeRecord.PresentationExchangeRecordBuilder<?,?> b)
-
PresentationExchangeRecord
public PresentationExchangeRecord()
-
PresentationExchangeRecord
public PresentationExchangeRecord(com.google.gson.JsonObject presentationProposalDict, PresentProofRequest.ProofRequest presentationRequest, com.google.gson.JsonObject presentationRequestDict, com.google.gson.JsonObject presentation, List<PresentationExchangeRecord.Identifier> identifiers, ExchangeVersion version)
-
-
Method Detail
-
hasCredentialDefinitionId
public boolean hasCredentialDefinitionId(@NonNull @NonNull String credentialDefinitionId)
-
hasSchemaId
public boolean hasSchemaId(@NonNull @NonNull String schemaId)
-
getPresentation
public com.google.gson.JsonObject getPresentation()
-
from
public <T> T from(@NonNull @NonNull Class<T> type)Sets the received presentation attributes on the instance. Only works for matching names. TheAttributeNameannotation can be used to exclude fields from processing or to handle different names. TheAttributeGroupNameannotation can be used to specify the attribute group name of the presentation in case there is more than one.- Type Parameters:
T- The class type- Parameters:
type- the POJO template to instantiate- Returns:
- Instance of the POJO with set properties
-
from
public Map<String,Object> from(@NonNull @NonNull Set<String> names)
Finds the attribute names in the proof and extracts their corresponding values. Note this is brute force and simply returns the first match found for each name It's recommended to usefindRevealedAttributes()orfindRevealedAttributeGroups()- Parameters:
names- Set of attribute names- Returns:
- Map containing the attribute names and their corresponding values
-
findRevealedAttributeGroups
public Map<String,PresentationExchangeRecord.RevealedAttributeGroup> findRevealedAttributeGroups()
Low level extractor that maps revealed attributes and values to their group{ "bank-account": { "revealed_attributes": { "bic": "1234", "iban": "4321" }, "identifier": { "schema_id": "M6Mbe3qx7vB4wpZF4sBRjt:2:bank_account:1.0", "cred_def_id": "F6dB7dMVHUQSC64qemnBi7:3:CL:571:mybank", "timestamp": "1628609220" } } }- Returns:
- revealed attributes mapped to their group
-
findRevealedAttributes
public Map<String,Object> findRevealedAttributes()
Low level extractor that returns a map of all revealed attributes and their values.{ "iban": "4321", "bic": "1234" }- Returns:
- revealed attribute to value mapping
-
findRevealedAttributedFull
public Map<String,PresentationExchangeRecord.RevealedAttribute> findRevealedAttributedFull()
Low level extractor that returns a map of all revealed attributes with the all their information. This is useful for all cases where access to the sub proof index is needed to extract the matching identifier from the identifiers list."iban": { "sub_proof_index": 0, "raw": "4321", "encoded": "26574491753489267293487534742481789407179815570291479106142274998003667228256" }, "bic": { "sub_proof_index": 0, "raw": "1234", "encoded": "95644933709556837616493211320418578774074706673436554047751118609009445904569" }- Returns:
- revealed attribute to value mapping
-
getVersion
public ExchangeVersion getVersion()
- Specified by:
getVersionin classBasePresExRecord
-
builder
public static PresentationExchangeRecord.PresentationExchangeRecordBuilder<?,?> builder()
-
getPresentationProposalDict
public com.google.gson.JsonObject getPresentationProposalDict()
-
getPresentationRequest
public PresentProofRequest.ProofRequest getPresentationRequest()
-
getPresentationRequestDict
public com.google.gson.JsonObject getPresentationRequestDict()
-
getIdentifiers
public List<PresentationExchangeRecord.Identifier> getIdentifiers()
-
setPresentationProposalDict
public void setPresentationProposalDict(com.google.gson.JsonObject presentationProposalDict)
-
setPresentationRequest
public void setPresentationRequest(PresentProofRequest.ProofRequest presentationRequest)
-
setPresentationRequestDict
public void setPresentationRequestDict(com.google.gson.JsonObject presentationRequestDict)
-
setPresentation
public void setPresentation(com.google.gson.JsonObject presentation)
-
setIdentifiers
public void setIdentifiers(List<PresentationExchangeRecord.Identifier> identifiers)
-
setVersion
public void setVersion(ExchangeVersion version)
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classBasePresExRecord
-
canEqual
protected boolean canEqual(Object other)
- Overrides:
canEqualin classBasePresExRecord
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBasePresExRecord
-
toString
public String toString()
- Overrides:
toStringin classBasePresExRecord
-
-