public static XContentBuilder marshall(AuditEntryBean bean) throws StorageException {
        try (XContentBuilder builder = XContentFactory.jsonBuilder()) {
            preMarshall(bean);
            builder
                .startObject()
                    .field("id", bean.getId())
                    .field("organizationId", bean.getOrganizationId())
                    .field("entityId", bean.getEntityId())
                    .field("entityType", bean.getEntityType())
                    .field("entityVersion", bean.getEntityVersion())
                    .field("data", bean.getData())
                    .field("who", bean.getWho())
                    .field("what", bean.getWhat())
                    .field("createdOn", bean.getCreatedOn().getTime())
                .endObject();
            postMarshall(bean);
            return builder;
        } catch (IOException e) {
            throw new StorageException(e);
        }
    }
public static XContentBuilder marshall ( AuditEntryBean bean ) throws StorageException { try ( XContentBuilder builder = XContentFactory . jsonBuilder ( ) ) { preMarshall ( bean ) ; builder . startObject ( ) . field ( "id" , bean . getId ( ) ) . field ( "organizationId" , bean . getOrganizationId ( ) ) . field ( "entityId" , bean . getEntityId ( ) ) . field ( "entityType" , bean . getEntityType ( ) ) . field ( "entityVersion" , bean . getEntityVersion ( ) ) . field ( "data" , bean . getData ( ) ) . field ( "who" , bean . getWho ( ) ) . field ( "what" , bean . getWhat ( ) ) . field ( "createdOn" , bean . getCreatedOn ( ) . getTime ( ) ) . endObject ( ) ; postMarshall ( bean ) ; return builder ; } catch ( IOException e ) { throw new StorageException ( e ) ; } }
Marshals the given bean into the given map.
@param bean the bean
@return the content builder
@throws StorageException when a storage problem occurs while storing a bean