class OrientKeyStoreDataEntityAdapter extends IterableEntityAdapter<OrientKeyStoreData> {

  @Nullable
  @Override
  public EntityEvent newEvent(final ODocument document, final EventKind eventKind) {
    EntityMetadata metadata = new AttachedEntityMetadata(this, document);
    String name = document.field(P_NAME);
    EntityEvent event;
    switch (eventKind) {
      case CREATE:
        event = new OrientKeyStoreDataCreatedEvent(metadata, name);
        break;
      case UPDATE:
        event = new OrientKeyStoreDataUpdatedEvent(metadata, name);
        break;
      default:
        event = null;
    }
    if (event != null) {
      log.debug("Emitted {} event for key store {} with metadata {}", eventKind, name, metadata);
    }
    return event;
  }

  public  OrientKeyStoreDataEntityAdapter();

}