Class DirectJobResponse
- java.lang.Object
-
- no.digipost.signature.client.direct.DirectJobResponse
-
public class DirectJobResponse extends Object
-
-
Constructor Summary
Constructors Constructor Description DirectJobResponse(long signatureJobId, String reference, URI statusUrl, List<DirectSignerResponse> signers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<DirectSignerResponse>
findSignerIdentifiedBy(String identifier)
Try to find the signer with the given identifier for this job.String
getReference()
long
getSignatureJobId()
DirectSignerResponse
getSignerIdentifiedBy(String identifier)
Get the signer with the given identifier for this job.List<DirectSignerResponse>
getSigners()
Gets all thesigners
for this jobDirectSignerResponse
getSingleSigner()
Gets the single signer for this job.URI
getStatusUrl()
-
-
-
Constructor Detail
-
DirectJobResponse
public DirectJobResponse(long signatureJobId, String reference, URI statusUrl, List<DirectSignerResponse> signers)
-
-
Method Detail
-
getSignatureJobId
public long getSignatureJobId()
-
getReference
public String getReference()
- Returns:
- the signature job's custom reference as specified upon
creation
. May benull
.
-
getSingleSigner
public DirectSignerResponse getSingleSigner()
Gets the single signer for this job. Convenience method for retrieving the signer for jobs with exactly one signer.- Returns:
- the signer
- Throws:
IllegalStateException
- if there are multiple signers for this job- See Also:
getSigners()
-
getSigners
public List<DirectSignerResponse> getSigners()
Gets all thesigners
for this job- Returns:
- the signers
-
getSignerIdentifiedBy
public DirectSignerResponse getSignerIdentifiedBy(String identifier)
Get the signer with the given identifier for this job.- Parameters:
identifier
- the string identifying the signer, either a personal identification number, or a custom identifier- Returns:
- the signer with the given identifier
- Throws:
NoSuchElementException
- if the signer was not found.
-
findSignerIdentifiedBy
public Optional<DirectSignerResponse> findSignerIdentifiedBy(String identifier)
Try to find the signer with the given identifier for this job. If you expect the signer to exist, consider usinggetSignerIdentifiedBy(String)
instead.
-
getStatusUrl
public URI getStatusUrl()
-
-