/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.identity.Identity
 *  com.l7tech.identity.internal.InternalUser
 *  com.l7tech.identity.mapping.InternalAttributeMapping
 *  com.l7tech.objectmodel.AttributeHeader
 */
package com.l7tech.server.identity.mapping;

import com.l7tech.identity.Identity;
import com.l7tech.identity.internal.InternalUser;
import com.l7tech.identity.mapping.InternalAttributeMapping;
import com.l7tech.objectmodel.AttributeHeader;
import com.l7tech.server.identity.mapping.AttributeExtractor;
import com.l7tech.server.identity.mapping.b;
import java.util.Date;

public class InternalAttributeExtractor
extends b<InternalAttributeMapping>
implements AttributeExtractor {
    public InternalAttributeExtractor(InternalAttributeMapping internalAttributeMapping) {
        super(internalAttributeMapping);
    }

    @Override
    public Object[] extractValues(Identity identity) {
        Object[] objectArray = super.extractValues(identity);
        if (objectArray != null && objectArray.length > 0) {
            return objectArray;
        }
        AttributeHeader attributeHeader = ((InternalAttributeMapping)this.mapping).getAttributeConfig().getHeader();
        if (identity instanceof InternalUser) {
            InternalUser internalUser = (InternalUser)identity;
            if (attributeHeader == InternalAttributeMapping.INTERNAL_USER_EXPIRATION) {
                return this.a(new Date(internalUser.getExpiration()));
            }
        }
        return this.EMPTY;
    }
}

