/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.Component
 *  com.l7tech.gateway.common.audit.AuditRecord
 *  com.l7tech.gateway.common.audit.SystemAuditRecord
 */
package com.l7tech.server.policy.variable;

import com.l7tech.gateway.common.Component;
import com.l7tech.gateway.common.audit.AuditRecord;
import com.l7tech.gateway.common.audit.SystemAuditRecord;
import com.l7tech.server.policy.variable.ExpandVariables;
import com.l7tech.server.policy.variable.aq;

class k
implements aq<AuditRecord> {
    k() {
    }

    @Override
    public ExpandVariables.Selector.Selection getFieldValue(AuditRecord auditRecord, String string) {
        if (auditRecord instanceof SystemAuditRecord) {
            SystemAuditRecord systemAuditRecord = (SystemAuditRecord)auditRecord;
            Component component = Component.fromId((int)systemAuditRecord.getComponentId());
            return new ExpandVariables.Selector.Selection(component == null ? null : component.getName());
        }
        return new ExpandVariables.Selector.Selection(null);
    }
}

