File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/types/scope Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,26 @@ public final class AtomTypeDefinition {
7
7
private final String name ;
8
8
private final List <Constructor > constructors ;
9
9
10
+ /**
11
+ * Constructs the type definition.
12
+ *
13
+ * @param name The simple name of the type, e.g. the "Name" in `type Name`
14
+ * @param constructors the list of constructor representations
15
+ */
10
16
public AtomTypeDefinition (String name , List <Constructor > constructors ) {
11
17
this .name = name ;
12
18
this .constructors = constructors ;
13
19
}
14
20
21
+ /** Returns the short name of the type. */
15
22
public String getName () {
16
23
return name ;
17
24
}
18
25
26
+ /**
27
+ * Returns the constructor of the type with the given name, or {@code null} if a constructor with
28
+ * that name does not exist.
29
+ */
19
30
public Constructor getConstructor (String name ) {
20
31
return constructors .stream ().filter (c -> c .name ().equals (name )).findFirst ().orElse (null );
21
32
}
You can’t perform that action at this time.
0 commit comments