

def ToSafeClassName(self, s, the_api, parent=None):
    'Convert a name to a suitable class name in Java.\n\n    Subclasses should override as appropriate.\n\n    Args:\n      s: (str) A canonical name for data element. (Usually the API wire format)\n      the_api: (Api) The API this element is part of. For use as a hint when the\n        name cannot be used directly.\n      parent: (schema) The parent we use to get a safe class name.\n    Returns:\n      A name suitable for use as an element in Java.\n    '
    safe_class_name = utilities.CamelCase(s)
    if parent:
        for ancestor in parent.full_path:
            if (ancestor.safeClassName == safe_class_name):
                safe_class_name = ('%s%s' % (parent.class_name, safe_class_name))
    if (safe_class_name.lower() in JavaLanguageModel.RESERVED_CLASS_NAMES):
        safe_class_name = ('%s%s' % (utilities.CamelCase(the_api.values['name']), utilities.CamelCase(s)))
    return safe_class_name

dataset/ETHPy150Open google/apis-client-generator/src/googleapis/codegen/java_generator.py JavaLanguageModel.ToSafeClassName/original