View Javadoc

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   {
8       private final static EntityExpander IDENTITY = new IdentityExpander();
9   
10      public boolean hasExpander(Class<?> type)
11      {
12          return true;
13      }
14  
15      public <T> EntityExpander<T> getExpander(Class<? extends T> type)
16      {
17          return IDENTITY;
18      }
19  
20      private static class IdentityExpander extends AbstractRecursiveEntityExpander<Object>
21      {
22          protected Object expandInternal(Object entity)
23          {
24              return entity;
25          }
26      }
27  }