Package org.hyperledger.aries.webhook
Class EventParser
- java.lang.Object
-
- org.hyperledger.aries.webhook.EventParser
-
public class EventParser extends Object
-
-
Constructor Summary
Constructors Constructor Description EventParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Tfrom(@NonNull String json, @NonNull Class<T> type)Converts the present_proof.presentation into an instance of the provided class type:static Map<String,Object>from(@NonNull String json, @NonNull Set<String> names)Finds the matching attribute names in the present_proof.presentation and extracts their corresponding values.static Set<Map.Entry<String,com.google.gson.JsonElement>>getRevealedAttributes(@NonNull String json)static Map<String,PresentationExchangeRecord.RevealedAttributeGroup>getValuesByAttributeGroup(@NonNull String json)static Map<String,Object>getValuesByRevealedAttributes(@NonNull String json)static Map<String,PresentationExchangeRecord.RevealedAttribute>getValuesByRevealedAttributesFull(@NonNull String json)static <T> Optional<T>parseElement(com.google.gson.JsonElement json, @NonNull Class<T> valueType)static <T> Optional<T>parseElement(com.google.gson.JsonElement json, @NonNull Type valueType)Optional<PresentationExchangeRecord>parsePresentProof(String json)<T> Optional<T>parseValueSave(@NonNull String json, @NonNull Class<T> valueType)<T> voidparseValueSave(@NonNull String json, @NonNull Class<T> valueType, Consumer<T> consumer)StringprettyJson(@NonNull String json)static List<PresentationExchangeRecord.Identifier>resolveIdentifiers(com.google.gson.JsonObject jo)
-
-
-
Method Detail
-
parseValueSave
public <T> Optional<T> parseValueSave(@NonNull @NonNull String json, @NonNull @NonNull Class<T> valueType)
-
parseElement
public static <T> Optional<T> parseElement(com.google.gson.JsonElement json, @NonNull @NonNull Class<T> valueType)
-
parseElement
public static <T> Optional<T> parseElement(com.google.gson.JsonElement json, @NonNull @NonNull Type valueType)
-
parseValueSave
public <T> void parseValueSave(@NonNull @NonNull String json, @NonNull @NonNull Class<T> valueType, Consumer<T> consumer)
-
parsePresentProof
public Optional<PresentationExchangeRecord> parsePresentProof(String json)
-
resolveIdentifiers
public static List<PresentationExchangeRecord.Identifier> resolveIdentifiers(com.google.gson.JsonObject jo)
-
from
public static <T> T from(@NonNull @NonNull String json, @NonNull @NonNull Class<T> type)Converts the present_proof.presentation into an instance of the provided class type:- Type Parameters:
T- The class type- Parameters:
json- present_proof.presentationtype- POJO instance- Returns:
- Instantiated type with all matching properties set
-
from
public static Map<String,Object> from(@NonNull @NonNull String json, @NonNull @NonNull Set<String> names)
Finds the matching attribute names in the present_proof.presentation and extracts their corresponding values. Note this is brute force and simply returns the first match found for each name It's recommended to usegetValuesByAttributeGroup(java.lang.String)orgetValuesByRevealedAttributes(java.lang.String)- Parameters:
json- present_proof.presentationnames- Set of attribute names- Returns:
- Map containing the attribute names and their corresponding values
-
getRevealedAttributes
public static Set<Map.Entry<String,com.google.gson.JsonElement>> getRevealedAttributes(@NonNull @NonNull String json)
-
getValuesByAttributeGroup
public static Map<String,PresentationExchangeRecord.RevealedAttributeGroup> getValuesByAttributeGroup(@NonNull @NonNull String json)
-
getValuesByRevealedAttributes
public static Map<String,Object> getValuesByRevealedAttributes(@NonNull @NonNull String json)
-
getValuesByRevealedAttributesFull
public static Map<String,PresentationExchangeRecord.RevealedAttribute> getValuesByRevealedAttributesFull(@NonNull @NonNull String json)
-
-