@Test public void shouldBuildComponentNameFromFlattenString() { val componentName = ComponentNameUtils.fromFlattenString("com.abc/MyActivity"); assertThat(componentName.getPackageName(), is("com.abc")); assertThat(componentName.getClassName(), is("MyActivity")); }
@NonNull public static ComponentName fromFlattenString(@Nullable final String flattenComponentName) { val parts = nullToEmpty(flattenComponentName).split(COMPONENT_NAME_SEPARATOR); return (parts.length == 2) ? new ComponentName(parts[0], parts[1]) : DUMMY_COMPONENT; }
ComponentNameUtils { @NonNull public static ComponentName fromFlattenString(@Nullable final String flattenComponentName) { val parts = nullToEmpty(flattenComponentName).split(COMPONENT_NAME_SEPARATOR); return (parts.length == 2) ? new ComponentName(parts[0], parts[1]) : DUMMY_COMPONENT; } }
ComponentNameUtils { @NonNull public static ComponentName fromFlattenString(@Nullable final String flattenComponentName) { val parts = nullToEmpty(flattenComponentName).split(COMPONENT_NAME_SEPARATOR); return (parts.length == 2) ? new ComponentName(parts[0], parts[1]) : DUMMY_COMPONENT; } private  ComponentNameUtils(); }
ComponentNameUtils { @NonNull public static ComponentName fromFlattenString(@Nullable final String flattenComponentName) { val parts = nullToEmpty(flattenComponentName).split(COMPONENT_NAME_SEPARATOR); return (parts.length == 2) ? new ComponentName(parts[0], parts[1]) : DUMMY_COMPONENT; } private  ComponentNameUtils(); @NonNull static String packageNameFrom(@Nullable final String flattenComponentName); @NonNull static ComponentName fromFlattenString(@Nullable final String flattenComponentName); }
ComponentNameUtils { @NonNull public static ComponentName fromFlattenString(@Nullable final String flattenComponentName) { val parts = nullToEmpty(flattenComponentName).split(COMPONENT_NAME_SEPARATOR); return (parts.length == 2) ? new ComponentName(parts[0], parts[1]) : DUMMY_COMPONENT; } private  ComponentNameUtils(); @NonNull static String packageNameFrom(@Nullable final String flattenComponentName); @NonNull static ComponentName fromFlattenString(@Nullable final String flattenComponentName); static final ComponentName DUMMY_COMPONENT; }