@Test public void get() { final Property<String> targetOne = new StaticValueProperty<>("Static"); final IDependencyObject<String> depOne = new PropertyBasedDependencyObject<>(targetOne, "Default"); Assert.assertEquals("Static", depOne.get(new DummyInjectionTarget())); }
@Nullable @Override public T get(@Nullable final Object context) { final T value = property.apply(context).orElse(def); lastResolvedHash = value != null ? value.hashCode() : 0; return value; }
PropertyBasedDependencyObject implements IDependencyObject<T> { @Nullable @Override public T get(@Nullable final Object context) { final T value = property.apply(context).orElse(def); lastResolvedHash = value != null ? value.hashCode() : 0; return value; } }
PropertyBasedDependencyObject implements IDependencyObject<T> { @Nullable @Override public T get(@Nullable final Object context) { final T value = property.apply(context).orElse(def); lastResolvedHash = value != null ? value.hashCode() : 0; return value; } PropertyBasedDependencyObject(@NotNull final Property<T> property, @Nullable final T def); }
PropertyBasedDependencyObject implements IDependencyObject<T> { @Nullable @Override public T get(@Nullable final Object context) { final T value = property.apply(context).orElse(def); lastResolvedHash = value != null ? value.hashCode() : 0; return value; } PropertyBasedDependencyObject(@NotNull final Property<T> property, @Nullable final T def); @Override boolean requiresDataContext(); @Nullable @Override T get(@Nullable final Object context); @Override void set(@Nullable final Object context, @Nullable final T value); @Override boolean hasChanged(@Nullable final Object context); }
PropertyBasedDependencyObject implements IDependencyObject<T> { @Nullable @Override public T get(@Nullable final Object context) { final T value = property.apply(context).orElse(def); lastResolvedHash = value != null ? value.hashCode() : 0; return value; } PropertyBasedDependencyObject(@NotNull final Property<T> property, @Nullable final T def); @Override boolean requiresDataContext(); @Nullable @Override T get(@Nullable final Object context); @Override void set(@Nullable final Object context, @Nullable final T value); @Override boolean hasChanged(@Nullable final Object context);  }