

def ToClassName(self, s, element, element_type=None):
    "Convert a discovery name to a suitable Java class name.\n\n    In Java, nested class names cannot share the same name as the outer class\n    name.\n\n    Overrides the default.\n\n    Args:\n      s: (str) A rosy name of data element.\n      element: (object) The object we need a class name for.\n      element_type: (str) The kind of object we need a class name for.\n    Returns:\n      A name suitable for use as a class in the generator's target language.\n    "
    name = utilities.CamelCase(s).replace(' ', '')
    if (name.lower() in JavaLanguageModel.RESERVED_CLASS_NAMES):
        service = (self._class_name or utilities.CamelCase(self.values['name']))
        return (service + name)
    if (name == self.values.get('className')):
        if ('resource' == element_type):
            name += 'Operations'
        elif ('method' == element_type):
            name += 'Operation'
    return name

dataset/ETHPy150Open google/apis-client-generator/src/googleapis/codegen/java_generator.py JavaApi.ToClassName/original