@Test public void testGetKeysFromTag() { EventTeamClickListener listener = new EventTeamClickListener(mContext); assertArrayEquals(new Object[]{"2015arc", "frc254"}, listener.getKeysFromTag("2015arc_frc254")); assertArrayEquals(new Object[]{"2015arc", "frc254B"}, listener.getKeysFromTag("2015arc_frc254B")); assertArrayEquals(new Object[]{null, null}, listener.getKeysFromTag(null)); listener = new EventTeamClickListener(mContext, "2015arc_frc254"); assertArrayEquals(new Object[]{"2015arc", "frc254"}, listener.getKeysFromTag("2015arc_frc254")); assertArrayEquals(new Object[]{"2015arc", "frc254B"}, listener.getKeysFromTag("2015arc_frc254B")); assertArrayEquals(new Object[]{"2015gal", "frc254"}, listener.getKeysFromTag("2015gal_frc254")); assertArrayEquals(new Object[]{"2015arc", "frc254"}, listener.getKeysFromTag("frc254")); assertArrayEquals(new Object[]{"2015arc", "frc111"}, listener.getKeysFromTag("frc111")); assertArrayEquals(new Object[]{"2015arc", "frc254B"}, listener.getKeysFromTag("frc254B")); assertArrayEquals(new Object[]{"2015arc", "frc254"}, listener.getKeysFromTag(null)); listener = new EventTeamClickListener(mContext, "2015arc", null); assertArrayEquals(new Object[]{"2015arc", "frc254"}, listener.getKeysFromTag("2015arc_frc254")); assertArrayEquals(new Object[]{"2015arc", "frc254B"}, listener.getKeysFromTag("2015arc_frc254B")); assertArrayEquals(new Object[]{"2015gal", "frc254"}, listener.getKeysFromTag("2015gal_frc254")); assertArrayEquals(new Object[]{"2015gal", "frc111"}, listener.getKeysFromTag("2015gal_frc111")); assertArrayEquals(new Object[]{"2015arc", "frc111"}, listener.getKeysFromTag("frc111")); assertArrayEquals(new Object[]{"2015arc", "frc111B"}, listener.getKeysFromTag("frc111B")); assertArrayEquals(new Object[]{"2015arc", null}, listener.getKeysFromTag(null)); listener = new EventTeamClickListener(mContext, "2015arc", "frc254"); assertArrayEquals(new Object[]{"2015arc", "frc254"}, listener.getKeysFromTag("2015arc_frc254")); assertArrayEquals(new Object[]{"2015arc", "frc254B"}, listener.getKeysFromTag("2015arc_frc254B")); assertArrayEquals(new Object[]{"2015gal", "frc254"}, listener.getKeysFromTag("2015gal_frc254")); assertArrayEquals(new Object[]{"2015arc", "frc254"}, listener.getKeysFromTag("frc254")); assertArrayEquals(new Object[]{"2015arc", "frc111"}, listener.getKeysFromTag("frc111")); assertArrayEquals(new Object[]{"2015arc", "frc254B"}, listener.getKeysFromTag("frc254B")); assertArrayEquals(new Object[]{"2015arc", "frc254"}, listener.getKeysFromTag(null)); }
String[] getKeysFromTag(Object tagObject) { String eventKey = null, teamKey = null; if (tagObject != null) { String tag = tagObject.toString(); if (EventTeamHelper.validateEventTeamKey(tag)) { eventKey = EventTeamHelper.getEventKey(tag); teamKey = EventTeamHelper.getTeamKey(tag); } else if (TeamHelper.validateTeamKey(tag) || TeamHelper.validateMultiTeamKey(tag)) { eventKey = mEventKey; teamKey = tag; } else { TbaLogger.w("EventTeamClickListener received invalid EventTeam Key! " + tag); eventKey = mEventKey; teamKey = mTeamKey; } } else { eventKey = mEventKey; teamKey = mTeamKey; } return new String[]{eventKey, teamKey}; }
EventTeamClickListener implements View.OnClickListener, View.OnLongClickListener, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener { String[] getKeysFromTag(Object tagObject) { String eventKey = null, teamKey = null; if (tagObject != null) { String tag = tagObject.toString(); if (EventTeamHelper.validateEventTeamKey(tag)) { eventKey = EventTeamHelper.getEventKey(tag); teamKey = EventTeamHelper.getTeamKey(tag); } else if (TeamHelper.validateTeamKey(tag) || TeamHelper.validateMultiTeamKey(tag)) { eventKey = mEventKey; teamKey = tag; } else { TbaLogger.w("EventTeamClickListener received invalid EventTeam Key! " + tag); eventKey = mEventKey; teamKey = mTeamKey; } } else { eventKey = mEventKey; teamKey = mTeamKey; } return new String[]{eventKey, teamKey}; } }
EventTeamClickListener implements View.OnClickListener, View.OnLongClickListener, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener { String[] getKeysFromTag(Object tagObject) { String eventKey = null, teamKey = null; if (tagObject != null) { String tag = tagObject.toString(); if (EventTeamHelper.validateEventTeamKey(tag)) { eventKey = EventTeamHelper.getEventKey(tag); teamKey = EventTeamHelper.getTeamKey(tag); } else if (TeamHelper.validateTeamKey(tag) || TeamHelper.validateMultiTeamKey(tag)) { eventKey = mEventKey; teamKey = tag; } else { TbaLogger.w("EventTeamClickListener received invalid EventTeam Key! " + tag); eventKey = mEventKey; teamKey = mTeamKey; } } else { eventKey = mEventKey; teamKey = mTeamKey; } return new String[]{eventKey, teamKey}; } EventTeamClickListener(@NonNull Context c);  EventTeamClickListener(@NonNull Context c, @NonNull String eventTeamKey);  EventTeamClickListener(@NonNull Context c, @NonNull String eventKey, @Nullable String teamKey); }
EventTeamClickListener implements View.OnClickListener, View.OnLongClickListener, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener { String[] getKeysFromTag(Object tagObject) { String eventKey = null, teamKey = null; if (tagObject != null) { String tag = tagObject.toString(); if (EventTeamHelper.validateEventTeamKey(tag)) { eventKey = EventTeamHelper.getEventKey(tag); teamKey = EventTeamHelper.getTeamKey(tag); } else if (TeamHelper.validateTeamKey(tag) || TeamHelper.validateMultiTeamKey(tag)) { eventKey = mEventKey; teamKey = tag; } else { TbaLogger.w("EventTeamClickListener received invalid EventTeam Key! " + tag); eventKey = mEventKey; teamKey = mTeamKey; } } else { eventKey = mEventKey; teamKey = mTeamKey; } return new String[]{eventKey, teamKey}; } EventTeamClickListener(@NonNull Context c);  EventTeamClickListener(@NonNull Context c, @NonNull String eventTeamKey);  EventTeamClickListener(@NonNull Context c, @NonNull String eventKey, @Nullable String teamKey); @Override void onClick(View v); @Override boolean onLongClick(View v); @Override void onItemClick(AdapterView<?> parent, View view, int position, long id); @Override boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id); }
EventTeamClickListener implements View.OnClickListener, View.OnLongClickListener, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener { String[] getKeysFromTag(Object tagObject) { String eventKey = null, teamKey = null; if (tagObject != null) { String tag = tagObject.toString(); if (EventTeamHelper.validateEventTeamKey(tag)) { eventKey = EventTeamHelper.getEventKey(tag); teamKey = EventTeamHelper.getTeamKey(tag); } else if (TeamHelper.validateTeamKey(tag) || TeamHelper.validateMultiTeamKey(tag)) { eventKey = mEventKey; teamKey = tag; } else { TbaLogger.w("EventTeamClickListener received invalid EventTeam Key! " + tag); eventKey = mEventKey; teamKey = mTeamKey; } } else { eventKey = mEventKey; teamKey = mTeamKey; } return new String[]{eventKey, teamKey}; } EventTeamClickListener(@NonNull Context c);  EventTeamClickListener(@NonNull Context c, @NonNull String eventTeamKey);  EventTeamClickListener(@NonNull Context c, @NonNull String eventKey, @Nullable String teamKey); @Override void onClick(View v); @Override boolean onLongClick(View v); @Override void onItemClick(AdapterView<?> parent, View view, int position, long id); @Override boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id);  }