1 package com.atlassian.plugins.rest.common.expand.resolver;
2
3 import com.atlassian.plugins.rest.common.expand.AbstractRecursiveEntityExpander;
4 import com.atlassian.plugins.rest.common.expand.EntityExpander;
5
6 public class IdentityEntityExpanderResolver implements EntityExpanderResolver {
7 private final static EntityExpander IDENTITY = new IdentityExpander();
8
9 public boolean hasExpander(Class<?> type) {
10 return true;
11 }
12
13 public <T> EntityExpander<T> getExpander(Class<? extends T> type) {
14 return IDENTITY;
15 }
16
17 private static class IdentityExpander extends AbstractRecursiveEntityExpander<Object> {
18 protected Object expandInternal(Object entity) {
19 return entity;
20 }
21 }
22 }