public class RecordTypeBuilder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
RecordTypeBuilder.RecordProperty |
Modifier and Type | Field and Description |
---|---|
private boolean |
isDeclared |
private boolean |
isEmpty |
private com.google.common.collect.ImmutableSortedMap.Builder<java.lang.String,RecordTypeBuilder.RecordProperty> |
properties |
private JSTypeRegistry |
registry |
Constructor and Description |
---|
RecordTypeBuilder(JSTypeRegistry registry) |
Modifier and Type | Method and Description |
---|---|
RecordTypeBuilder |
addProperty(java.lang.String name,
JSType type,
Node propertyNode)
Adds a property with the given name and type to the record type.
|
JSType |
build()
Creates a record.
|
(package private) void |
setSynthesized(boolean synthesized)
See the comments on RecordType about synthetic types.
|
private boolean isEmpty
private boolean isDeclared
private final JSTypeRegistry registry
private final com.google.common.collect.ImmutableSortedMap.Builder<java.lang.String,RecordTypeBuilder.RecordProperty> properties
public RecordTypeBuilder(JSTypeRegistry registry)
void setSynthesized(boolean synthesized)
public RecordTypeBuilder addProperty(java.lang.String name, JSType type, Node propertyNode)
build()
will fail.name
- the name of the new propertytype
- the JSType of the new propertypropertyNode
- the node that holds this property definitionpublic JSType build()