in scrooge-generator/src/main/scala/com/twitter/scrooge/android_generator/AndroidGenerator.scala [66:108]
override def typeName(
t: FunctionType,
inContainer: Boolean = false,
inInit: Boolean = false,
skipGeneric: Boolean = false,
fileNamespace: Option[Identifier] = None
): String = {
t match {
case Void => if (inContainer) "Void" else "void"
case OnewayVoid => if (inContainer) "Void" else "void"
case at: AnnotatedFieldType =>
typeName(at.unwrap, inContainer, inInit, skipGeneric, fileNamespace)
case TBool => if (inContainer) "Boolean" else "boolean"
case TByte => if (inContainer) "Byte" else "byte"
case TI16 => if (inContainer) "Short" else "short"
case TI32 => if (inContainer) "Integer" else "int"
case TI64 => if (inContainer) "Long" else "long"
case TDouble => if (inContainer) "Double" else "double"
case TString => "String"
case TBinary => "ByteBuffer"
case n: NamedType =>
qualifyNamedType(n.sid, n.scopePrefix, fileNamespace).fullName
case MapType(k, v, _) => {
val prefix = if (inInit) "HashMap" else "Map"
prefix + (if (skipGeneric) ""
else
"<" + typeName(k, inContainer = true) + "," + typeName(
v,
inContainer = true) + ">")
}
case SetType(x, _) => {
val prefix = if (inInit) "HashSet" else "Set"
prefix + (if (skipGeneric) "" else "<" + typeName(x, inContainer = true) + ">")
}
case ListType(x, _) => {
val prefix = if (inInit) "ArrayList" else "List"
prefix + (if (skipGeneric) "" else "<" + typeName(x, inContainer = true) + ">")
}
case r: ReferenceType =>
throw new ScroogeInternalException("ReferenceType should not appear in backend")
case _ => throw new ScroogeInternalException("unknown type")
}
}