1 package com.atlassian.plugins.rest.common.expand;
2
3 import com.atlassian.plugins.rest.common.expand.resolver.EntityExpanderResolver;
4
5 /**
6 * <p>Interface for expanding entities.</p>
7 * <p>For recursive expansion consider implementing {@link AbstractRecursiveEntityExpander}</p>
8 *
9 * @param <T> the type of entity to expand.
10 */
11 public interface EntityExpander<T> {
12 /**
13 * @param context the current entity context
14 * @param entityCrawler the entity crawler to be used for recursive expansion.
15 * @param expanderResolver the resolver for finding further expander when doing recursive expansion.
16 * @return the expanded entity. This can be a completely different object (of the same type). This MUST NOT be {@code null}.
17 */
18 T expand(ExpandContext<T> context, EntityExpanderResolver expanderResolver, EntityCrawler entityCrawler);
19 }