]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ConstantPropertyVariableBuilder.java
possibleObjectForType utility
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / variable / ConstantPropertyVariableBuilder.java
1 package org.simantics.db.layer0.variable;
2
3 import java.util.ArrayList;
4 import java.util.Collection;
5 import java.util.Collections;
6 import java.util.Set;
7
8 import org.simantics.databoard.binding.Binding;
9
10 public class ConstantPropertyVariableBuilder {
11
12     final String name;
13     final Object value;
14     final Binding binding;
15     final Collection<ConstantPropertyVariableBuilder> properties;
16     final Set<String> classifications;
17
18     public ConstantPropertyVariableBuilder(String name, Object value, Binding binding, Collection<ConstantPropertyVariableBuilder> properties, Set<String> classifications) {
19         this.name = name;
20         this.value = value;
21         this.binding = binding;
22         this.properties = properties;
23         this.classifications = classifications;
24     }
25
26     public ConstantPropertyVariableBuilder(String name, Object value, Binding binding) {
27         this(name, value, binding, new ArrayList<ConstantPropertyVariableBuilder>(), Collections.<String>emptySet());
28     }
29
30     public String getName() {
31         return name;
32     }
33     
34         public ConstantPropertyVariable build(Variable parent) {
35                 return new ConstantPropertyVariable(parent, name, value, binding, properties, classifications);
36         }
37         
38 }