/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.service.PublishedService
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.util.Functions
 *  com.l7tech.util.Functions$Binary
 *  com.l7tech.util.Pair
 *  com.l7tech.util.Triple
 */
package com.l7tech.server.service.resolution;

import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.objectmodel.Goid;
import com.l7tech.server.service.resolution.ServiceResolutionException;
import com.l7tech.server.service.resolution.a;
import com.l7tech.server.service.resolution.b;
import com.l7tech.server.service.resolution.c;
import com.l7tech.util.Functions;
import com.l7tech.util.Pair;
import com.l7tech.util.Triple;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class NonUniqueServiceResolutionException
extends ServiceResolutionException {
    private final Collection<Pair<Map<String, Object>, PublishedService>> conflictingParameterCollection;
    static final long serialVersionUID = 2375180986765792784L;
    private static final String a = NonUniqueServiceResolutionException.a(80, NonUniqueServiceResolutionException.a("2\u0006sFSa\u0010\t\fn\tOu\u0016\u0001\u000ee]Zf\u0017@\u0000oGYx\r\u0003\u0017 ^V`\f@\fnL\u001f{\u0016@\u000eo[Z4\u0017\u0005\u0011v@\\q\u0017"));

    public NonUniqueServiceResolutionException(Collection<Pair<Map<String, Object>, PublishedService>> collection) {
        super(a);
        this.conflictingParameterCollection = collection;
    }

    public Set<Goid> getConflictingServices() {
        return (Set)Functions.reduce(this.conflictingParameterCollection, new HashSet(), (Functions.Binary)new a(this));
    }

    public String getServiceName(Goid goid, boolean bl2) {
        return (String)Functions.reduce(this.conflictingParameterCollection, null, (Functions.Binary)new b(this, goid, bl2));
    }

    public Set<Triple<String, String, String>> getParameters(Goid goid) {
        return (Set)Functions.reduce(this.conflictingParameterCollection, new HashSet(), (Functions.Binary)new c(this, goid));
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x34);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 48;
                    case 1 -> 51;
                    case 2 -> 80;
                    case 3 -> 121;
                    case 4 -> 111;
                    case 5 -> 68;
                    default -> 52;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

