private static TypeName typeWithoutDataEnumSuffixes()

in dataenum-processor/src/main/java/com/spotify/dataenum/processor/generator/data/OutputValueFactory.java [68:96]


  private static TypeName typeWithoutDataEnumSuffixes(TypeName typeName) throws ParserException {
    if (typeName instanceof ParameterizedTypeName) {
      ParameterizedTypeName paramTypeName = (ParameterizedTypeName) typeName;

      ClassName outputClassName;
      if (isSpecClassName(paramTypeName.rawType)) {
        outputClassName = toOutputClassName(paramTypeName.rawType);
      } else {
        outputClassName = paramTypeName.rawType;
      }

      TypeName[] typeArgumentsArr = new TypeName[paramTypeName.typeArguments.size()];
      for (int i = 0; i < typeArgumentsArr.length; i++) {
        typeArgumentsArr[i] = typeWithoutDataEnumSuffixes(paramTypeName.typeArguments.get(i));
      }

      return ParameterizedTypeName.get(outputClassName, typeArgumentsArr);
    }

    if (typeName instanceof ClassName) {
      ClassName className = (ClassName) typeName;
      if (isSpecClassName(className)) {
        return toOutputClassName(className);
      }
      return className;
    }

    return typeName;
  }