class SofaBeanNameGenerator {

    private static final String SERVICE_BEAN_NAME_PREFIX   = "ServiceFactoryBean#";

    private static final String REFERENCE_BEAN_NAME_PREFIX = "ReferenceFactoryBean#";

    public static String generateSofaServiceBeanName(BeanDefinition definition) {<FILL_FUNCTION_BODY>}

    public static String generateSofaServiceBeanName(Class<?> interfaceType, String uniqueId) {
        return generateSofaServiceBeanName(interfaceType.getCanonicalName(), uniqueId);
    }

    public static String generateSofaServiceBeanName(String interfaceName, String uniqueId,
                                                     String beanId) {
        return generateSofaServiceBeanName(interfaceName, uniqueId) + ":" + beanId;
    }

    public static String generateSofaServiceBeanName(Class<?> interfaceType, String uniqueId,
                                                     String beanId) {
        return generateSofaServiceBeanName(interfaceType, uniqueId) + ":" + beanId;
    }

    public static String generateSofaServiceBeanName(String interfaceName, String uniqueId) {
        if (!StringUtils.hasText(uniqueId)) {
            return SERVICE_BEAN_NAME_PREFIX + interfaceName;
        }
        return SERVICE_BEAN_NAME_PREFIX + interfaceName + ":" + uniqueId;
    }

    public static String generateSofaReferenceBeanName(Class<?> interfaceType, String uniqueId) {
        if (!StringUtils.hasText(uniqueId)) {
            return REFERENCE_BEAN_NAME_PREFIX + interfaceType.getCanonicalName();
        }
        return REFERENCE_BEAN_NAME_PREFIX + interfaceType.getCanonicalName() + ":" + uniqueId;
    }
}

        String interfaceName = (String) definition.getPropertyValues().get(
            AbstractContractDefinitionParser.INTERFACE_PROPERTY);
        Class<?> clazz = (Class<?>) definition.getPropertyValues().get(
            AbstractContractDefinitionParser.INTERFACE_CLASS_PROPERTY);
        if (clazz != null) {
            interfaceName = clazz.getCanonicalName();
        }
        String uniqueId = (String) definition.getPropertyValues().get(
            AbstractContractDefinitionParser.UNIQUE_ID_PROPERTY);
        return generateSofaServiceBeanName(interfaceName, uniqueId, (String) definition
            .getPropertyValues().get(BEAN_ID));
    
<no_super_class>