Use myProperty.index() for single property indexes (because it is most convenient).
For more complex indexes, like multi-column indexes, use addIndex(index):
Index index = new Index();
index.addProperty(property1);
index.addProperty(property2);
entity.addIndex(index);