private static ObjectDefinition getExtensionObjectDefinition( ExtensionDefinitionContract extensionDefinition, String defaultApplicationId) { if (StringUtils.isBlank(extensionDefinition.getApplicationId()) && StringUtils.isNotBlank(defaultApplicationId)) { return new ObjectDefinition( extensionDefinition.getResourceDescriptor(), defaultApplicationId); } else { return new ObjectDefinition( extensionDefinition.getResourceDescriptor(), extensionDefinition.getApplicationId()); } }
public static Builder create(ExtensionDefinitionContract contract) { if (contract == null) { throw new IllegalArgumentException("contract was null"); } Builder builder = create(contract.getName(), contract.getType(), contract.getResourceDescriptor()); builder.setId(contract.getId()); builder.setApplicationId(contract.getApplicationId()); builder.setLabel(contract.getLabel()); builder.setDescription(contract.getDescription()); builder.setConfiguration(contract.getConfiguration()); builder.setVersionNumber(contract.getVersionNumber()); return builder; }