-
Notifications
You must be signed in to change notification settings - Fork 5
/
GSBuilderDefaults.java
53 lines (40 loc) · 1.84 KB
/
GSBuilderDefaults.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package org.genericsystem.reactor.modelproperties;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.genericsystem.common.Generic;
import org.genericsystem.reactor.Context;
import javafx.beans.property.Property;
import javafx.beans.value.ObservableValue;
public interface GSBuilderDefaults extends ContextProperty {
public static final String COMPONENTS_MAP = "componentsMap";
public static final String HOLDERS_MAP = "holdersMap";
public static final String INVALID_LIST = "invalidList";
public static final String MULTIPLE_RELATION = "multipleRelation";
default void createHoldersMapProperty() {
createNewInitializedProperty(HOLDERS_MAP, model -> new HashMap<Generic, Property<Serializable>>());
}
default void createComponentsMapProperty() {
createNewInitializedProperty(COMPONENTS_MAP, model -> new HashMap<Generic, List<Property<Context>>>());
};
default void createInvalidListProperty() {
createNewInitializedProperty(INVALID_LIST, model -> new ArrayList<ObservableValue<Boolean>>());
};
default void createMultipleRelationProperty() {
createNewInitializedProperty(MULTIPLE_RELATION, context -> new HashMap<Generic, Map<Generic, Property<Serializable>>>());
}
default Property<List<ObservableValue<Boolean>>> getInvalidListProperty(Context model) {
return getProperty(INVALID_LIST, model);
}
default Property<Map<Generic, Property<Serializable>>> getHoldersMapProperty(Context model) {
return getProperty(HOLDERS_MAP, model);
}
default Property<Map<Generic, List<Property<Context>>>> getComponentsMapProperty(Context model) {
return getProperty(COMPONENTS_MAP, model);
}
default Property<Map<Generic, Map<Generic, Property<Serializable>>>> getMultipleRelationProperty(Context context) {
return getProperty(MULTIPLE_RELATION, context);
}
}