@Test void testGetEntityTypeIdFromClassError() { assertThrows(InvalidTypeIdException.class, () -> entityHelper.getEntityTypeIdFromType("error")); }
String getEntityTypeIdFromType(String typeId) { String result; switch (typeId) { case PackageIdentity.PACKAGE: result = PackageMetadata.PACKAGE; break; case EntityTypeIdentity.ENTITY_TYPE: result = EntityTypeMetadata.ENTITY_TYPE_META_DATA; break; case PLUGIN: result = SYS_PLUGIN; break; case GroupIdentity.GROUP: result = GroupMetadata.GROUP; break; default: if (typeId.startsWith(ENTITY_PREFIX)) { result = typeId.substring(7); } else { throw new InvalidTypeIdException(typeId); } break; } return result; }
EntityHelper { String getEntityTypeIdFromType(String typeId) { String result; switch (typeId) { case PackageIdentity.PACKAGE: result = PackageMetadata.PACKAGE; break; case EntityTypeIdentity.ENTITY_TYPE: result = EntityTypeMetadata.ENTITY_TYPE_META_DATA; break; case PLUGIN: result = SYS_PLUGIN; break; case GroupIdentity.GROUP: result = GroupMetadata.GROUP; break; default: if (typeId.startsWith(ENTITY_PREFIX)) { result = typeId.substring(7); } else { throw new InvalidTypeIdException(typeId); } break; } return result; } }
EntityHelper { String getEntityTypeIdFromType(String typeId) { String result; switch (typeId) { case PackageIdentity.PACKAGE: result = PackageMetadata.PACKAGE; break; case EntityTypeIdentity.ENTITY_TYPE: result = EntityTypeMetadata.ENTITY_TYPE_META_DATA; break; case PLUGIN: result = SYS_PLUGIN; break; case GroupIdentity.GROUP: result = GroupMetadata.GROUP; break; default: if (typeId.startsWith(ENTITY_PREFIX)) { result = typeId.substring(7); } else { throw new InvalidTypeIdException(typeId); } break; } return result; } EntityHelper(DataService dataService); }
EntityHelper { String getEntityTypeIdFromType(String typeId) { String result; switch (typeId) { case PackageIdentity.PACKAGE: result = PackageMetadata.PACKAGE; break; case EntityTypeIdentity.ENTITY_TYPE: result = EntityTypeMetadata.ENTITY_TYPE_META_DATA; break; case PLUGIN: result = SYS_PLUGIN; break; case GroupIdentity.GROUP: result = GroupMetadata.GROUP; break; default: if (typeId.startsWith(ENTITY_PREFIX)) { result = typeId.substring(7); } else { throw new InvalidTypeIdException(typeId); } break; } return result; } EntityHelper(DataService dataService); ObjectIdentity getObjectIdentity(String classId, String objectIdentifier); String getLabel(String typeId, String untypedIdentifier); String getLabel(String typeId); LabelledObjectIdentity getLabelledObjectIdentity(ObjectIdentity objectIdentity); void checkEntityExists(ObjectIdentity objectIdentity); void checkEntityTypeExists(String typeId); void checkIsNotSystem(String typeId); }
EntityHelper { String getEntityTypeIdFromType(String typeId) { String result; switch (typeId) { case PackageIdentity.PACKAGE: result = PackageMetadata.PACKAGE; break; case EntityTypeIdentity.ENTITY_TYPE: result = EntityTypeMetadata.ENTITY_TYPE_META_DATA; break; case PLUGIN: result = SYS_PLUGIN; break; case GroupIdentity.GROUP: result = GroupMetadata.GROUP; break; default: if (typeId.startsWith(ENTITY_PREFIX)) { result = typeId.substring(7); } else { throw new InvalidTypeIdException(typeId); } break; } return result; } EntityHelper(DataService dataService); ObjectIdentity getObjectIdentity(String classId, String objectIdentifier); String getLabel(String typeId, String untypedIdentifier); String getLabel(String typeId); LabelledObjectIdentity getLabelledObjectIdentity(ObjectIdentity objectIdentity); void checkEntityExists(ObjectIdentity objectIdentity); void checkEntityTypeExists(String typeId); void checkIsNotSystem(String typeId); static final String ENTITY_PREFIX; static final String PLUGIN; static final String SYS_PLUGIN; }