Used switch case in place of if else if
This commit is contained in:
parent
d780357089
commit
1e02edd42c
|
@ -421,16 +421,24 @@ public class SchemaManagementImpl implements SchemaManagement {
|
||||||
|
|
||||||
ERManagement<? extends OElement> erManagement = null;
|
ERManagement<? extends OElement> erManagement = null;
|
||||||
|
|
||||||
if(Resource.class.isAssignableFrom(accessType.getTypeClass())) {
|
switch(accessType) {
|
||||||
erManagement = new ResourceTypeDefinitionManagement();
|
case PROPERTY:
|
||||||
}else if(Facet.class.isAssignableFrom(accessType.getTypeClass())) {
|
erManagement = new PropertyTypeDefinitionManagement();
|
||||||
erManagement = new FacetTypeDefinitionManagement();
|
break;
|
||||||
} else if(IsRelatedTo.class.isAssignableFrom(accessType.getTypeClass())) {
|
case RESOURCE:
|
||||||
erManagement = new IsRelatedToTypeDefinitionManagement();
|
erManagement = new ResourceTypeDefinitionManagement();
|
||||||
} else if(ConsistsOf.class.isAssignableFrom(accessType.getTypeClass())) {
|
break;
|
||||||
erManagement = new ConsistsOfTypeDefinitionManagement();
|
case FACET:
|
||||||
} else if(Property.class.isAssignableFrom(accessType.getTypeClass())) {
|
erManagement = new FacetTypeDefinitionManagement();
|
||||||
erManagement = new PropertyTypeDefinitionManagement();
|
break;
|
||||||
|
case IS_RELATED_TO:
|
||||||
|
erManagement = new IsRelatedToTypeDefinitionManagement();
|
||||||
|
break;
|
||||||
|
case CONSISTS_OF:
|
||||||
|
erManagement = new ConsistsOfTypeDefinitionManagement();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
String ret = null;
|
String ret = null;
|
||||||
|
|
|
@ -191,8 +191,7 @@ public class SchemaManagementImplTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Test(expected=SchemaAlreadyPresentException.class)
|
@Test(expected=SchemaAlreadyPresentException.class)
|
||||||
@Test
|
|
||||||
public void createPropertyType() throws Exception {
|
public void createPropertyType() throws Exception {
|
||||||
PropertyTypeDefinition<ValueSchema> propertyTypeDefinition = new PropertyTypeDefinitionImpl<>(ValueSchema.class);
|
PropertyTypeDefinition<ValueSchema> propertyTypeDefinition = new PropertyTypeDefinitionImpl<>(ValueSchema.class);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue