1111
1212import java .io .Reader ;
1313import java .net .URI ;
14- import java .util .Date ;
15- import java .util .List ;
16- import java .util .Map ;
14+ import java .util .*;
1715
1816public class VerifiableCredential extends JsonLDObject {
1917
@@ -42,7 +40,7 @@ public static class Builder<B extends Builder<B>> extends JsonLDObject.Builder<B
4240 private Date expirationDate ;
4341 private CredentialSubject credentialSubject ;
4442 private CredentialStatus credentialStatus ;
45- private LdProof ldProof ;
43+ private List < LdProof > ldProof ;
4644
4745 public Builder (VerifiableCredential jsonLdObject ) {
4846 super (jsonLdObject );
@@ -63,7 +61,7 @@ public VerifiableCredential build() {
6361 if (this .expirationDate != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , VerifiableCredentialKeywords .JSONLD_TERM_EXPIRATIONDATE , JsonLDUtils .dateToString (this .expirationDate ));
6462 if (this .credentialSubject != null ) this .credentialSubject .addToJsonLDObject (this .jsonLdObject );
6563 if (this .credentialStatus != null ) this .credentialStatus .addToJsonLDObject (this .jsonLdObject );
66- if (this .ldProof != null ) this .ldProof .addToJsonLDObject (this .jsonLdObject );
64+ if (this .ldProof != null ) this .ldProof .forEach ( ldProof -> ldProof . addToJsonLDObject (this .jsonLdObject ) );
6765
6866 return (VerifiableCredential ) this .jsonLdObject ;
6967 }
@@ -94,7 +92,14 @@ public B credentialStatus(CredentialStatus credentialStatus) {
9492 }
9593
9694 public B ldProof (LdProof ldProof ) {
97- this .ldProof = ldProof ;
95+ if (this .ldProof == null ) this .ldProof = new ArrayList <>();
96+ this .ldProof .add (ldProof );
97+ return (B ) this ;
98+ }
99+
100+ public B ldProof (Collection <LdProof > ldProof ) {
101+ if (this .ldProof == null ) this .ldProof = new ArrayList <>();
102+ this .ldProof .addAll (ldProof );
98103 return (B ) this ;
99104 }
100105 }
0 commit comments