/*
 * Created on Nov 1, 2004
 * Copyright (C) Andrea Schweer, 2004
 *
 * This file is part of the Greenstone Alerting Service.
 * Refer to the COPYING file in the base directory of this package
 * for licensing information.
 */
package org.greenstone.gsdlas.profiles;

import java.util.Map;


/**
 * @author schweer
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class EqualsPredicate extends Predicate {

    public EqualsPredicate(String field, String id) {
        super.field = field;
        super.value = id;
    }

    /* (non-Javadoc)
     * @see org.greenstone.gsdlas.profiles.Predicate#isSatisfied(java.util.Map)
     */
    public boolean isSatisfied(Map event) {
        String value = (String) event.get(field);
        return value != null && value.equals(value);
    }

}