JsonRepresentation asEventRepr(EventMetadata metadata, final JsonRepresentation payloadRepr) {
        final JsonRepresentation eventRepr = JsonRepresentation.newMap();
        final JsonRepresentation metadataRepr = JsonRepresentation.newMap();
        eventRepr.mapPut("metadata", metadataRepr);
        metadataRepr.mapPut("id", metadata.getId());
        metadataRepr.mapPut("transactionId", metadata.getTransactionId());
        metadataRepr.mapPut("sequence", metadata.getSequence());
        metadataRepr.mapPut("eventType", metadata.getEventType());
        metadataRepr.mapPut("user", metadata.getUser());
        metadataRepr.mapPut("timestamp", metadata.getTimestamp());
        eventRepr.mapPut("payload", payloadRepr);
        return eventRepr;
    }
JsonRepresentation asEventRepr ( EventMetadata metadata , final JsonRepresentation payloadRepr ) { final JsonRepresentation eventRepr = JsonRepresentation . newMap ( ) ; final JsonRepresentation metadataRepr = JsonRepresentation . newMap ( ) ; eventRepr . mapPut ( "metadata" , metadataRepr ) ; metadataRepr . mapPut ( "id" , metadata . getId ( ) ) ; metadataRepr . mapPut ( "transactionId" , metadata . getTransactionId ( ) ) ; metadataRepr . mapPut ( "sequence" , metadata . getSequence ( ) ) ; metadataRepr . mapPut ( "eventType" , metadata . getEventType ( ) ) ; metadataRepr . mapPut ( "user" , metadata . getUser ( ) ) ; metadataRepr . mapPut ( "timestamp" , metadata . getTimestamp ( ) ) ; eventRepr . mapPut ( "payload" , payloadRepr ) ; return eventRepr ; }
region > supporting methods