package com.onaro.sanscreen.client.view.changes; import com.onaro.sanscreen.types.ChangeType; import com.onaro.util.SetUtil; import java.util.Set; /** * A filter for devices up/down changes. */ public class TypeFilterDeviceUpDown implements TypeFilter { /** * The set of types that defines up/down changes. */ public final static Set ACCEPTED_CHANGE_TYPES = SetUtil.setOf( ChangeType.DEVICE_UP, ChangeType.DEVICE_DOWN, ChangeType.DEVICE_CREATED, ChangeType.TOO_MANY_CHANGES); /** * Tests if a change-group is for a device up/down change. * @param changeGroup the change-group * @return true if this change is a device up/down */ public boolean shouldBeDisplayed(ChangeGroup changeGroup) { return ACCEPTED_CHANGE_TYPES.contains(changeGroup.getType()); } }