@OnCreateInitialState static void onCreateInitialState( final ComponentContext c, StateValue<AtomicReference<EditTextWithEventHandlers>> mountedView, StateValue<AtomicBoolean> configuredInitialText) { mountedView.set(new AtomicReference<EditTextWithEventHandlers>()); configuredInitialText.set(new AtomicBoolean()); }
@Test public void testIncrementClickCount() { final StateValue<Integer> count = new StateValue<>(); count.set(0); LearningStateComponentSpec.incrementClickCount(count); LithoAssertions.assertThat(count).valueEqualTo(1); } }
/** Equivalent to calling <code>assertThat(value.get()).isEqualTo(value)</code>. */ public StateValueAssert<T> valueEqualTo(T value) { Java6Assertions.assertThat(actual.get()) .overridingErrorMessage( "Expected state value to equal to <%s>, but was <%s>.", value, actual.get()) .isEqualTo(value); return this; } }
@OnCreateInitialState static void onCreateInitialState( final ComponentContext c, StateValue<AtomicReference<EditTextWithEventHandlers>> mountedView, StateValue<AtomicReference<CharSequence>> savedText, StateValue<Integer> measureSeqNumber, @Prop(optional = true, resType = ResType.STRING) CharSequence initialText) { mountedView.set(new AtomicReference<EditTextWithEventHandlers>()); measureSeqNumber.set(0); savedText.set(new AtomicReference<>(initialText)); }
@OnCreateInitialState public static <T> void onCreateInitialState( SectionContext c, StateValue<HashSet> blacklistState) { blacklistState.set(new HashSet()); }
@OnCreateInitialState protected static void onCreateInitialState( SectionContext c, StateValue<Integer> extra) { extra.set(0); }
@OnCreateInitialState protected static void onCreateInitialState( ComponentContext c, StateValue<Integer> measureVersion) { measureVersion.set(0); }
@OnCreateInitialState static void createInitialState(ComponentContext c, StateValue<Optional<String>> error) { error.set(Optional.<String>empty()); }
@OnCreateInitialState static void createInitialState(ComponentContext c, StateValue<Optional<Exception>> error) { error.set(Optional.<Exception>empty()); }
@OnCreateInitialState static void onCreateInitialState(ComponentContext c, StateValue<Integer> count) { count.set(0); }