@Test public void testGetAgEntity_NoRelationships() { AgEntity<Tr> tr = metadata.getAgEntity(Tr.class); assertNotNull(tr); assertEquals("Tr", tr.getName()); assertSame(Tr.class, tr.getType()); assertEquals("Tr", tr.getName()); assertNotNull(tr.getAttribute("a")); assertNotNull(tr.getAttribute("b")); assertEquals(0, tr.getRelationships().size()); }
@Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; }
MetadataService implements IMetadataService { @Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; } }
MetadataService implements IMetadataService { @Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; } MetadataService(@Inject List<AgEntityCompiler> entityCompilers); }
MetadataService implements IMetadataService { @Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; } MetadataService(@Inject List<AgEntityCompiler> entityCompilers); @Override AgEntity<T> getAgEntity(Class<T> type); @Override AgEntity<T> getAgEntityByType(Type entityType); }
MetadataService implements IMetadataService { @Override public <T> AgEntity<T> getAgEntity(Class<T> type) { if (type == null) { throw new NullPointerException("Null type"); } AgEntity<T> e = dataMap.getEntity(type); if (e == null) { throw new AgException(Status.BAD_REQUEST, "Invalid entity: " + type.getName()); } return e; } MetadataService(@Inject List<AgEntityCompiler> entityCompilers); @Override AgEntity<T> getAgEntity(Class<T> type); @Override AgEntity<T> getAgEntityByType(Type entityType);  }