package com.ifpdos.udi.sdk.service.doc.base;

import androidx.constraintlayout.core.motion.utils.TypedValues;
import androidx.core.app.NotificationCompat;
import com.ifpdos.udi.sdk.kotlin.comment.parser.CommentDetails;
import com.seewo.vcommons.constants.SeewoConstants;
import com.seewo.vcommons.constants.SeewoIntent;
import com.seewo.vcommons.utils.ShellCommandUtils;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlin.text.CharsKt;
import kotlin.text.StringsKt;
import okhttp3.HttpUrl;

/* JADX INFO: compiled from: Utils.kt */
/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000x\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010!\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0010\u001b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0010%\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0002\b\r\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0018\u0010\u001b\u001a\u00020\u00052\u0006\u0010\u001c\u001a\u00020\u00052\b\b\u0002\u0010\u001d\u001a\u00020\u001eJ\u0010\u0010\u001f\u001a\u00020 2\u0006\u0010!\u001a\u00020\"H\u0002J\u0018\u0010#\u001a\u00020\u00172\u0006\u0010$\u001a\u00020 2\u0006\u0010%\u001a\u00020\u0005H\u0002J\u000e\u0010&\u001a\u00020\u00052\u0006\u0010'\u001a\u00020\u0005J\u000e\u0010(\u001a\u00020\u00052\u0006\u0010)\u001a\u00020\u0005J\u0014\u0010*\u001a\b\u0012\u0004\u0012\u00020\u00050\u00132\u0006\u0010)\u001a\u00020\u0005J\u0016\u0010+\u001a\u00020\u00052\u0006\u0010$\u001a\u00020,2\u0006\u0010-\u001a\u00020\u0005J\u0016\u0010+\u001a\u00020\u00052\u0006\u0010$\u001a\u00020.2\u0006\u0010-\u001a\u00020\u0005J\u0010\u0010/\u001a\u0004\u0018\u00010\u00052\u0006\u00100\u001a\u000201J\u000e\u00102\u001a\u00020\u00052\u0006\u00100\u001a\u000201J\u000e\u00103\u001a\u00020\u00052\u0006\u0010%\u001a\u00020\u0005J\u000e\u00104\u001a\u00020\u00052\u0006\u0010%\u001a\u00020\u0005J\u000e\u00105\u001a\u00020\u00052\u0006\u0010%\u001a\u00020\u0005J\u000e\u00106\u001a\u00020\u00172\u0006\u0010'\u001a\u00020\u0005J\u000e\u00107\u001a\u0002082\u0006\u0010\u0019\u001a\u00020\u001aJ\u000e\u00109\u001a\u00020\u00172\u0006\u0010:\u001a\u00020\u0005J\u000e\u0010;\u001a\u00020\u00172\u0006\u0010$\u001a\u00020.J\u000e\u0010<\u001a\u00020\u00172\u0006\u0010)\u001a\u00020\u0005J\u000e\u0010=\u001a\u00020\u00172\u0006\u0010)\u001a\u00020\u0005J\u000e\u0010>\u001a\u00020\u00052\u0006\u0010?\u001a\u00020\u0005J\u000e\u0010@\u001a\u00020\u00052\u0006\u0010A\u001a\u00020\u0005J\u000e\u0010B\u001a\u00020\u00052\u0006\u0010?\u001a\u00020\u0005J\u0010\u0010C\u001a\u00020\u00052\b\u0010?\u001a\u0004\u0018\u00010\u0005J\u000e\u0010D\u001a\u00020\u00052\u0006\u0010:\u001a\u00020\u0005R\u0014\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0005X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0005X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0005X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\u0005X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u0005X\u0086T¢\u0006\u0002\n\u0000R\u0014\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\r0\fX\u0082\u0004¢\u0006\u0002\n\u0000R\u0016\u0010\u000e\u001a\n \u0010*\u0004\u0018\u00010\u000f0\u000fX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0005X\u0086T¢\u0006\u0002\n\u0000R\u0014\u0010\u0012\u001a\b\u0012\u0004\u0012\u00020\u00050\u0013X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0005X\u0086T¢\u0006\u0002\n\u0000R\u001a\u0010\u0015\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00170\u0016X\u0082\u0004¢\u0006\u0002\n\u0000R\u001a\u0010\u0018\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00170\u0016X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0019\u001a\u00020\u001aX\u0082.¢\u0006\u0002\n\u0000¨\u0006E"}, d2 = {"Lcom/ifpdos/udi/sdk/service/doc/base/Utils;", "", "()V", "BUILD_IN_TYPES", "", "", "CLASS_KOTLIN_LIST", "CLASS_LIST", "CLASS_MAP", "EMPTY_BODY", "NO_NOTIFY", "PARAM_NAME_CLASS", "Ljava/lang/Class;", "", "PARAM_NAME_VALUE_METHOD", "Ljava/lang/reflect/Method;", "kotlin.jvm.PlatformType", "PROTOCOL_PACKAGE", "RAW_BUILD_IN_TYPES", "", "UDI_REQUEST", "listTypeCheckResult", "", "", "mapTypeCheckResult", "processingEnv", "Ljavax/annotation/processing/ProcessingEnvironment;", "addTab", "lines", "level", "", "asTypeElement", "Ljavax/lang/model/element/TypeElement;", "t", "Ljavax/lang/model/type/TypeMirror;", "checkClass", "element", "clazz", "filterJavaLangBuildType", "className", "getGenericClassName", "fullName", "getGenericParameterTypes", "getParamName", "Ljava/lang/reflect/AnnotatedElement;", SeewoConstants.PANEL_DEFAULT, "Ljavax/lang/model/element/Element;", "getServiceModuleUrl", "serviceComment", "Lcom/ifpdos/udi/sdk/kotlin/comment/parser/CommentDetails;", "getServiceName", "getTypeByList", "getTypeByMapKey", "getTypeByMapValue", "hasGenericParam", "init", "", "isBuildType", SeewoIntent.KEY_FILE_TYPE, "isHideApi", "isListType", "isMapType", "removeClassSuffix", "str", "removeJsonFormat", "json", "strTitleCase", "titleCase", "toWrapperTypeIfIsRawBuildInType", "doc-base"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class Utils {
    private static final String CLASS_KOTLIN_LIST = "List";
    private static final String CLASS_LIST = "java.util.List";
    private static final String CLASS_MAP = "java.util.Map";
    public static final String EMPTY_BODY = "com.ifpdos.udi.sdk.service.sdk.protocol.EmptyBody";
    public static final String NO_NOTIFY = "com.ifpdos.udi.sdk.service.compile.NoNotify";
    private static final Class<Annotation> PARAM_NAME_CLASS;
    private static final Method PARAM_NAME_VALUE_METHOD;
    public static final String PROTOCOL_PACKAGE = "com.ifpdos.udi.sdk.service.sdk.protocol";
    public static final String UDI_REQUEST = "com.ifpdos.udi.sdk.service.sdk.server.UdiRequest";
    private static final Map<String, Boolean> listTypeCheckResult;
    private static final Map<String, Boolean> mapTypeCheckResult;
    private static ProcessingEnvironment processingEnv;
    public static final Utils INSTANCE = new Utils();
    private static final List<String> RAW_BUILD_IN_TYPES = CollectionsKt.listOf((Object[]) new String[]{"byte", "int", "short", "long", TypedValues.Custom.S_FLOAT, "double", TypedValues.Custom.S_BOOLEAN});
    private static final List<String> BUILD_IN_TYPES = CollectionsKt.mutableListOf("byte", "int", "short", "long", TypedValues.Custom.S_FLOAT, "double", TypedValues.Custom.S_BOOLEAN, "Byte", "Int", "Short", "UShort", "Integer", "Long", "Float", "Double", "Boolean", "String");

    private Utils() {
    }

    static {
        Class cls = Class.forName("com.ifpdos.udi.sdk.service.compile.ParamName");
        if (cls == null) {
            throw new NullPointerException("null cannot be cast to non-null type java.lang.Class<kotlin.Annotation>");
        }
        PARAM_NAME_CLASS = cls;
        PARAM_NAME_VALUE_METHOD = cls.getMethod("value", new Class[0]);
        listTypeCheckResult = new LinkedHashMap();
        mapTypeCheckResult = new LinkedHashMap();
    }

    public final void init(ProcessingEnvironment processingEnv2) {
        Intrinsics.checkNotNullParameter(processingEnv2, "processingEnv");
        processingEnv = processingEnv2;
    }

    public final List<String> getGenericParameterTypes(String fullName) {
        Intrinsics.checkNotNullParameter(fullName, "fullName");
        ArrayList arrayList = new ArrayList();
        int iIndexOf$default = StringsKt.indexOf$default((CharSequence) fullName, "<", 0, false, 6, (Object) null) + 1;
        int length = fullName.length() - 1;
        StringBuilder sb = new StringBuilder();
        String strSubstring = fullName.substring(iIndexOf$default, length);
        Intrinsics.checkNotNullExpressionValue(strSubstring, "this as java.lang.String…ing(startIndex, endIndex)");
        char[] charArray = strSubstring.toCharArray();
        Intrinsics.checkNotNullExpressionValue(charArray, "this as java.lang.String).toCharArray()");
        int i = 0;
        for (char c : charArray) {
            if (c == ',' && i == 0) {
                String string = sb.toString();
                Intrinsics.checkNotNullExpressionValue(string, "sb.toString()");
                arrayList.add(string);
                StringsKt.clear(sb);
            } else {
                if (c == '<') {
                    i++;
                } else if (c == '>') {
                    i--;
                }
                sb.append(c);
            }
        }
        String string2 = sb.toString();
        Intrinsics.checkNotNullExpressionValue(string2, "sb.toString()");
        if (StringsKt.startsWith$default(string2, "? extends ", false, 2, (Object) null)) {
            String string3 = sb.toString();
            Intrinsics.checkNotNullExpressionValue(string3, "sb.toString()");
            String strSubstring2 = string3.substring("? extends ".length());
            Intrinsics.checkNotNullExpressionValue(strSubstring2, "this as java.lang.String).substring(startIndex)");
            arrayList.add(strSubstring2);
        } else {
            String string4 = sb.toString();
            Intrinsics.checkNotNullExpressionValue(string4, "sb.toString()");
            arrayList.add(string4);
        }
        return arrayList;
    }

    public final String getGenericClassName(String fullName) {
        Intrinsics.checkNotNullParameter(fullName, "fullName");
        if (!hasGenericParam(fullName)) {
            return fullName;
        }
        String strSubstring = fullName.substring(0, StringsKt.indexOf$default((CharSequence) fullName, "<", 0, false, 6, (Object) null));
        Intrinsics.checkNotNullExpressionValue(strSubstring, "this as java.lang.String…ing(startIndex, endIndex)");
        return strSubstring;
    }

    public final boolean hasGenericParam(String className) {
        Intrinsics.checkNotNullParameter(className, "className");
        return StringsKt.contains$default((CharSequence) className, (CharSequence) "<", false, 2, (Object) null);
    }

    public final String titleCase(String str) {
        if (str == null) {
            return "";
        }
        StringBuilder sbAppend = new StringBuilder().append(Character.toUpperCase(str.charAt(0)));
        String strSubstring = str.substring(1);
        Intrinsics.checkNotNullExpressionValue(strSubstring, "this as java.lang.String).substring(startIndex)");
        return sbAppend.append(strSubstring).toString();
    }

    public final String getTypeByList(String clazz) {
        String strTitleCase;
        Intrinsics.checkNotNullParameter(clazz, "clazz");
        if (StringsKt.endsWith$default(clazz, HttpUrl.PATH_SEGMENT_ENCODE_SET_URI, false, 2, (Object) null)) {
            String strSubstring = clazz.substring(0, clazz.length() - 2);
            Intrinsics.checkNotNullExpressionValue(strSubstring, "this as java.lang.String…ing(startIndex, endIndex)");
            strTitleCase = titleCase(strSubstring);
        } else {
            strTitleCase = getGenericParameterTypes(clazz).get(0);
        }
        if (StringsKt.startsWith$default(strTitleCase, "? extends ", false, 2, (Object) null)) {
            String strSubstring2 = strTitleCase.substring("? extends ".length());
            Intrinsics.checkNotNullExpressionValue(strSubstring2, "this as java.lang.String).substring(startIndex)");
            return filterJavaLangBuildType(strSubstring2);
        }
        return filterJavaLangBuildType(strTitleCase);
    }

    public final String getTypeByMapKey(String clazz) {
        Intrinsics.checkNotNullParameter(clazz, "clazz");
        return filterJavaLangBuildType(getGenericParameterTypes(clazz).get(0));
    }

    public final String getTypeByMapValue(String clazz) {
        Intrinsics.checkNotNullParameter(clazz, "clazz");
        return filterJavaLangBuildType(getGenericParameterTypes(clazz).get(1));
    }

    public final String toWrapperTypeIfIsRawBuildInType(String type) {
        Intrinsics.checkNotNullParameter(type, "type");
        return RAW_BUILD_IN_TYPES.contains(type) ? titleCase(type) : type;
    }

    public final String filterJavaLangBuildType(String className) {
        Intrinsics.checkNotNullParameter(className, "className");
        if (StringsKt.startsWith$default(className, "java.lang.", false, 2, (Object) null)) {
            String strSubstring = className.substring("java.lang.".length());
            Intrinsics.checkNotNullExpressionValue(strSubstring, "this as java.lang.String).substring(startIndex)");
            return strSubstring;
        }
        if (!StringsKt.startsWith$default(className, "kotlin.", false, 2, (Object) null) || StringsKt.split$default((CharSequence) className, new String[]{"."}, false, 0, 6, (Object) null).size() != 2) {
            return className;
        }
        String strSubstring2 = className.substring("kotlin.".length());
        Intrinsics.checkNotNullExpressionValue(strSubstring2, "this as java.lang.String).substring(startIndex)");
        return strSubstring2;
    }

    public final boolean isListType(String fullName) {
        Intrinsics.checkNotNullParameter(fullName, "fullName");
        ProcessingEnvironment processingEnvironment = null;
        if (StringsKt.startsWith$default(fullName, CLASS_LIST, false, 2, (Object) null) || StringsKt.startsWith$default(fullName, CLASS_KOTLIN_LIST, false, 2, (Object) null) || StringsKt.endsWith$default(fullName, HttpUrl.PATH_SEGMENT_ENCODE_SET_URI, false, 2, (Object) null)) {
            return true;
        }
        Map<String, Boolean> map = listTypeCheckResult;
        if (map.containsKey(fullName)) {
            Boolean bool = map.get(fullName);
            Intrinsics.checkNotNull(bool);
            return bool.booleanValue();
        }
        ProcessingEnvironment processingEnvironment2 = processingEnv;
        if (processingEnvironment2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("processingEnv");
        } else {
            processingEnvironment = processingEnvironment2;
        }
        TypeElement typeElement = processingEnvironment.getElementUtils().getTypeElement(getGenericClassName(fullName));
        boolean zCheckClass = typeElement != null ? INSTANCE.checkClass(typeElement, CLASS_LIST) : false;
        map.put(fullName, Boolean.valueOf(zCheckClass));
        return zCheckClass;
    }

    private final boolean checkClass(TypeElement element, String clazz) {
        if (Intrinsics.areEqual(element.toString(), clazz)) {
            return true;
        }
        if (element.getSuperclass().getKind() != TypeKind.NONE) {
            TypeMirror superclass = element.getSuperclass();
            Intrinsics.checkNotNullExpressionValue(superclass, "element.superclass");
            if (checkClass(asTypeElement(superclass), clazz)) {
                return true;
            }
        }
        for (TypeMirror i : element.getInterfaces()) {
            Intrinsics.checkNotNullExpressionValue(i, "i");
            if (checkClass(asTypeElement(i), clazz)) {
                return true;
            }
        }
        return false;
    }

    private final TypeElement asTypeElement(TypeMirror t) {
        ProcessingEnvironment processingEnvironment = processingEnv;
        if (processingEnvironment == null) {
            Intrinsics.throwUninitializedPropertyAccessException("processingEnv");
            processingEnvironment = null;
        }
        TypeElement typeElementAsElement = processingEnvironment.getTypeUtils().asElement(t);
        if (typeElementAsElement != null) {
            return typeElementAsElement;
        }
        throw new NullPointerException("null cannot be cast to non-null type javax.lang.model.element.TypeElement");
    }

    public final boolean isMapType(String fullName) {
        Intrinsics.checkNotNullParameter(fullName, "fullName");
        ProcessingEnvironment processingEnvironment = null;
        if (StringsKt.startsWith$default(fullName, CLASS_MAP, false, 2, (Object) null)) {
            return true;
        }
        Map<String, Boolean> map = mapTypeCheckResult;
        if (map.containsKey(fullName)) {
            Boolean bool = map.get(fullName);
            Intrinsics.checkNotNull(bool);
            return bool.booleanValue();
        }
        ProcessingEnvironment processingEnvironment2 = processingEnv;
        if (processingEnvironment2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("processingEnv");
        } else {
            processingEnvironment = processingEnvironment2;
        }
        TypeElement typeElement = processingEnvironment.getElementUtils().getTypeElement(getGenericClassName(fullName));
        boolean zCheckClass = typeElement != null ? INSTANCE.checkClass(typeElement, CLASS_MAP) : false;
        map.put(fullName, Boolean.valueOf(zCheckClass));
        return zCheckClass;
    }

    public final boolean isBuildType(String type) {
        Intrinsics.checkNotNullParameter(type, "type");
        return BUILD_IN_TYPES.contains(type);
    }

    public final String strTitleCase(String str) {
        Intrinsics.checkNotNullParameter(str, "str");
        if (str.length() <= 0) {
            return str;
        }
        StringBuilder sb = new StringBuilder();
        char cCharAt = str.charAt(0);
        Locale ROOT = Locale.ROOT;
        Intrinsics.checkNotNullExpressionValue(ROOT, "ROOT");
        StringBuilder sbAppend = sb.append((Object) CharsKt.titlecase(cCharAt, ROOT));
        String strSubstring = str.substring(1);
        Intrinsics.checkNotNullExpressionValue(strSubstring, "this as java.lang.String).substring(startIndex)");
        return sbAppend.append(strSubstring).toString();
    }

    public final String removeJsonFormat(String json) {
        Intrinsics.checkNotNullParameter(json, "json");
        return StringsKt.replace$default(StringsKt.replace$default(StringsKt.replace$default(json, "\"", "\\\"", false, 4, (Object) null), ShellCommandUtils.COMMAND_LINE_END, "", false, 4, (Object) null), "\t", "", false, 4, (Object) null);
    }

    public static /* synthetic */ String addTab$default(Utils utils, String str, int i, int i2, Object obj) {
        if ((i2 & 2) != 0) {
            i = 1;
        }
        return utils.addTab(str, i);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r2v5, types: [T, java.lang.String] */
    public final String addTab(String lines, int level) {
        Intrinsics.checkNotNullParameter(lines, "lines");
        final Ref.ObjectRef objectRef = new Ref.ObjectRef();
        objectRef.element = "";
        for (int i = 0; i < level; i++) {
            objectRef.element = ((String) objectRef.element) + '\t';
        }
        return CollectionsKt.joinToString$default(StringsKt.split$default((CharSequence) StringsKt.trim((CharSequence) lines).toString(), new String[]{ShellCommandUtils.COMMAND_LINE_END}, false, 0, 6, (Object) null), ShellCommandUtils.COMMAND_LINE_END, null, null, 0, null, new Function1<String, CharSequence>() { // from class: com.ifpdos.udi.sdk.service.doc.base.Utils.addTab.1
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(1);
            }

            @Override // kotlin.jvm.functions.Function1
            public final CharSequence invoke(String it) {
                Intrinsics.checkNotNullParameter(it, "it");
                return objectRef.element + it;
            }
        }, 30, null);
    }

    public final String getParamName(Element element, String str) throws IllegalAccessException, InvocationTargetException {
        Intrinsics.checkNotNullParameter(element, "element");
        Intrinsics.checkNotNullParameter(str, "default");
        Annotation annotation = element.getAnnotation(PARAM_NAME_CLASS);
        if (annotation == null) {
            return str;
        }
        Object objInvoke = PARAM_NAME_VALUE_METHOD.invoke(annotation, new Object[0]);
        if (objInvoke == null) {
            throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
        }
        String str2 = (String) objInvoke;
        return str2 != null ? str2 : str;
    }

    public final String getParamName(AnnotatedElement element, String str) throws IllegalAccessException, InvocationTargetException {
        Intrinsics.checkNotNullParameter(element, "element");
        Intrinsics.checkNotNullParameter(str, "default");
        Annotation annotation = element.getAnnotation(PARAM_NAME_CLASS);
        if (annotation == null) {
            return str;
        }
        Object objInvoke = PARAM_NAME_VALUE_METHOD.invoke(annotation, new Object[0]);
        if (objInvoke == null) {
            throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
        }
        String str2 = (String) objInvoke;
        return str2 != null ? str2 : str;
    }

    public final String getServiceName(CommentDetails serviceComment) {
        String str;
        Intrinsics.checkNotNullParameter(serviceComment, "serviceComment");
        List<String> list = serviceComment.getAnnotations().get("name");
        if (list != null && (str = list.get(0)) != null) {
            String lowerCase = str.toLowerCase(Locale.ROOT);
            Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(Locale.ROOT)");
            if (lowerCase != null) {
                return lowerCase;
            }
        }
        String summary = serviceComment.getSummary();
        return summary == null ? NotificationCompat.CATEGORY_SERVICE : summary;
    }

    public final String getServiceModuleUrl(CommentDetails serviceComment) {
        Intrinsics.checkNotNullParameter(serviceComment, "serviceComment");
        List<String> list = serviceComment.getAnnotations().get("moduleUrl");
        if (list != null) {
            return list.get(0);
        }
        return null;
    }

    public final boolean isHideApi(Element element) {
        Intrinsics.checkNotNullParameter(element, "element");
        List annotationMirrors = element.getAnnotationMirrors();
        Intrinsics.checkNotNullExpressionValue(annotationMirrors, "element.annotationMirrors");
        Iterator it = annotationMirrors.iterator();
        while (it.hasNext()) {
            if (Intrinsics.areEqual("@com.ifpdos.udi.sdk.service.compile.Hide", ((AnnotationMirror) it.next()).toString())) {
                return true;
            }
        }
        return false;
    }

    public final String removeClassSuffix(String str) {
        Intrinsics.checkNotNullParameter(str, "str");
        if (!StringsKt.endsWith$default(str, ".class", false, 2, (Object) null)) {
            return str;
        }
        String strSubstring = str.substring(0, str.length() - ".class".length());
        Intrinsics.checkNotNullExpressionValue(strSubstring, "this as java.lang.String…ing(startIndex, endIndex)");
        return strSubstring;
    }
}
