#115 patch group alias - resolves issue where wildcard aliases were being matched against a temporary patch group id and removed from the alias list for the lifespan of the patch group. General cleanup of the rollup methods for the patch group alias. Adds a new method to alias list that allows alias lookup from a tgid while excluding wildcard talkgroups.

This commit is contained in:
Denny
2017-01-17 20:43:49 -05:00
parent 6a9e522d77
commit 95a6deaae1
3 changed files with 35 additions and 20 deletions

View File

@@ -579,8 +579,12 @@ public class AliasList implements Listener<AliasEvent>
/**
* Lookup alias by talkgroup
*
* @param tgid to use when searching for an alias
* @param includeWildcards true if you want to additionally search for a matching alias that contains wildcard(s)
* when there is not a direct match to the TGID.
*/
public Alias getTalkgroupAlias(String tgid)
public Alias getTalkgroupAlias(String tgid, boolean includeWildcards)
{
Alias alias = null;
@@ -588,7 +592,7 @@ public class AliasList implements Listener<AliasEvent>
{
alias = mTalkgroup.get(tgid);
if (alias == null)
if (alias == null && includeWildcards)
{
String wildcard = getWildcardMatch(tgid, mTalkgroupWildcards);
@@ -603,8 +607,16 @@ public class AliasList implements Listener<AliasEvent>
}
/**
* Alias list name
* Lookup alias by talkgroup. Defaults to matching to wildcard talkgroups.
*/
public Alias getTalkgroupAlias(String tgid)
{
return getTalkgroupAlias(tgid, true);
}
/**
* Alias list name
*/
public String toString()
{
return mName;