Better comments on Activity.getEntities

This commit is contained in:
Tracy Boehrer 2019-08-27 16:10:26 -05:00
Родитель e5c49e2f25
Коммит e01774729a
1 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -759,6 +759,24 @@ public class Activity {
}
/**
* Returns payload version of the Entities in an Activity.
*
* Entities can vary in the number of fields. The {@link Entity} class holds the additional
* fields in {@link Entity#getProperties()}.
*
* To convert to other entity types, use {@link Entity#getAs(Class)}.
* @see Mention
* @see Place
* @see GeoCoordinates
* @see Activity#getMentions()
*
* {@code
* getEntities().stream()
* .filter(entity -> entity.getType().equalsIgnoreCase("mention"))
* .map(entity -> entity.getAs(Mention.class))
* .collect(Collectors.toCollection(ArrayList::new));
* }
*
* @see #entities
*/
public List<Entity> getEntities() {