T
- type of the menu entry this filter handlespublic abstract class EntryIdIncludeExcludeFilter<T extends MenuEntry> extends Object implements MenuEntryFilter<T>
Constructor and Description |
---|
EntryIdIncludeExcludeFilter() |
Modifier and Type | Method and Description |
---|---|
void |
addEntryToExclude(String entryId)
Add the ID of an entry that should only be included if the condition is not fulfilled If the
same ID was also added via
addEntryToInclude(String) the inclusion takes precedence. |
void |
addEntryToInclude(String entryId)
Add the ID of an entry that should only be included if the condition is fulfilled
|
boolean |
include(T entry)
Whether the menu entry should be included in the menu
|
void |
removeEntryToExclude(String entryId)
Remove a previously added entry ID from those that should be excluded.
|
void |
removeEntryToInclude(String entryId)
Remove a previously added entry ID from those that should be included.
|
protected abstract boolean |
testCondition(T entry)
Test the condition and return true if the condition is fulfilled.
|
public void addEntryToExclude(String entryId)
addEntryToInclude(String)
the inclusion takes precedence.entryId
- the ID of the entry to checkpublic void addEntryToInclude(String entryId)
entryId
- the ID of the entry to checkpublic boolean include(T entry)
MenuEntryFilter
include
in interface MenuEntryFilter<T extends MenuEntry>
entry
- the entry to testpublic void removeEntryToExclude(String entryId)
entryId
- the ID of the entrypublic void removeEntryToInclude(String entryId)
entryId
- the ID of the entryprotected abstract boolean testCondition(T entry)
entry
- the entry to testCopyright © 2019 Communote team. All rights reserved.