Search in sources :

Example 1 with ID

use of org.folio.circulation.domain.notice.session.PatronActionSessionProperties.ID in project mod-circulation by folio-org.

the class PatronSessionRecord method from.

public static PatronSessionRecord from(JsonObject representation) {
    UUID id = getUUIDProperty(representation, ID);
    UUID patronId = getUUIDProperty(representation, PATRON_ID);
    UUID loanId = getUUIDProperty(representation, LOAN_ID);
    String actionTypeValue = getProperty(representation, ACTION_TYPE);
    return PatronActionType.from(actionTypeValue).map(patronActionType -> new PatronSessionRecord(id, patronId, loanId, patronActionType)).orElse(null);
}
Also used : PATRON_ID(org.folio.circulation.domain.notice.session.PatronActionSessionProperties.PATRON_ID) ID(org.folio.circulation.domain.notice.session.PatronActionSessionProperties.ID) ACTION_TYPE(org.folio.circulation.domain.notice.session.PatronActionSessionProperties.ACTION_TYPE) Objects.requireNonNull(java.util.Objects.requireNonNull) Loan(org.folio.circulation.domain.Loan) JsonObject(io.vertx.core.json.JsonObject) LOAN_ID(org.folio.circulation.domain.notice.session.PatronActionSessionProperties.LOAN_ID) UUID(java.util.UUID) JsonPropertyFetcher.getUUIDProperty(org.folio.circulation.support.json.JsonPropertyFetcher.getUUIDProperty) JsonPropertyFetcher.getProperty(org.folio.circulation.support.json.JsonPropertyFetcher.getProperty) UUID(java.util.UUID)

Aggregations

JsonObject (io.vertx.core.json.JsonObject)1 Objects.requireNonNull (java.util.Objects.requireNonNull)1 UUID (java.util.UUID)1 Loan (org.folio.circulation.domain.Loan)1 ACTION_TYPE (org.folio.circulation.domain.notice.session.PatronActionSessionProperties.ACTION_TYPE)1 ID (org.folio.circulation.domain.notice.session.PatronActionSessionProperties.ID)1 LOAN_ID (org.folio.circulation.domain.notice.session.PatronActionSessionProperties.LOAN_ID)1 PATRON_ID (org.folio.circulation.domain.notice.session.PatronActionSessionProperties.PATRON_ID)1 JsonPropertyFetcher.getProperty (org.folio.circulation.support.json.JsonPropertyFetcher.getProperty)1 JsonPropertyFetcher.getUUIDProperty (org.folio.circulation.support.json.JsonPropertyFetcher.getUUIDProperty)1