/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.util.Functions
 *  com.l7tech.util.Functions$Unary
 *  com.l7tech.util.Functions$UnaryThrows
 *  com.l7tech.util.Functions$UnaryVoid
 *  com.l7tech.util.TextUtils
 */
package com.l7tech.server.util;

import com.l7tech.util.Functions;
import com.l7tech.util.TextUtils;
import java.util.Arrays;
import java.util.Collections;
import java.util.regex.Pattern;

class e
implements Functions.UnaryThrows<Iterable<String>, Object, RuntimeException> {
    final Pattern val$splitPattern;
    final Functions.UnaryVoid val$notStringCallback;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    e(Pattern pattern, Functions.UnaryVoid unaryVoid) {
        this.val$splitPattern = pattern;
        this.val$notStringCallback = unaryVoid;
    }

    public Iterable<String> call(Object object) throws RuntimeException {
        if (object instanceof String) {
            String string = (String)object;
            if (this.val$splitPattern != null) {
                String[] stringArray = this.val$splitPattern.split(string);
                return Functions.grep(Arrays.asList(stringArray), (Functions.Unary)TextUtils.isNotEmpty());
            }
            return Functions.grep(Arrays.asList(string), (Functions.Unary)TextUtils.isNotEmpty());
        }
        try {
            if (this.val$notStringCallback != null) {
                this.val$notStringCallback.call(object);
            }
        }
        catch (RuntimeException runtimeException) {
            throw e.a(runtimeException);
        }
        return Collections.emptyList();
    }

    private static RuntimeException a(RuntimeException runtimeException) {
        return runtimeException;
    }
}

