code: @Override
    public ODocument toStream() {
      document.setInternalStatus(ORecordElement.STATUS.UNMARSHALLING);
      final List<ODocument> inds = new ArrayList<ODocument>(indexDefinitions.size());
      final List<String> indClasses = new ArrayList<String>(indexDefinitions.size());
  
      try {
        document.field("className", className);
        for (final OIndexDefinition indexDefinition : indexDefinitions) {
          final ODocument indexDocument = indexDefinition.toStream();
          inds.add(indexDocument);
  
          indClasses.add(indexDefinition.getClass().getName());
        }
        document.field("indexDefinitions", inds, OType.EMBEDDEDLIST);
        document.field("indClasses", indClasses, OType.EMBEDDEDLIST);
      } finally {
        document.setInternalStatus(ORecordElement.STATUS.LOADED);
      }
      return document;
    }
docs: {@inheritDoc}