package org.genericsystem.ui;

import java.util.function.Consumer;
import java.util.function.Function;

import javafx.beans.property.Property;

public class Boot<NODE> {

	private final Function<NODE, Property<?>> method;

	private Boot(Function<NODE, Property<?>> method) {
		this.method = method;
	}

	public void init(NODE node) {
		method.apply(node);
	}

	public static <NODE, VALUE> Boot<NODE> setProperty(Function<NODE, Property<VALUE>> getProperty, VALUE value) {
		return new Boot<>(node -> {
			getProperty.apply(node).setValue(value);
			return null;
		});
	}

	public static <NODE> Boot<NODE> apply(Consumer<NODE> method) {
		return new Boot<>(object -> {
			method.accept(object);
			return null;
		});
	}
}

@@ -96,17 +96,16 @@
 nction;%0A
-%0A
 import j
@@ -182,119 +182,101 @@
 nal 
-Function%3CNODE, Property%3C?%3E%3E method;%0A%0A%09private Boot(Function%3CNODE, Property%3C?%3E%3E method) %7B%0A%09%09this.method = method
+Consumer%3CNODE%3E consumer;%0A%0A%09private Boot(Consumer%3CNODE%3E consumer) %7B%0A%09%09this.consumer = consumer
 ;%0A%09%7D
@@ -314,20 +314,23 @@
 %7B%0A%09%09
-method.apply
+consumer.accept
 (nod
@@ -477,21 +477,16 @@
 node -%3E 
-%7B%0A%09%09%09
 getPrope
@@ -516,37 +516,16 @@
 e(value)
-;%0A%09%09%09return null;%0A%09%09%7D
 );%0A%09%7D%0A%0A%09
@@ -621,13 +621,8 @@
  -%3E 
-%7B%0A%09%09%09
 meth
@@ -642,29 +642,8 @@
 ect)
-;%0A%09%09%09return null;%0A%09%09%7D
 );%0A%09

Refactor Boot