public JSType build ( ) { // If we have an empty record, simply return the object type. if ( isEmpty ) { return registry . getNativeObjectType ( JSTypeNative . OBJECT_TYPE ) ; } ImmutableSortedMap . Builder < String , RecordProperty > m = ImmutableSortedMap . naturalOrder ( ) ; m . putAll ( this . properties ) ; return new RecordType ( registry , m . build ( ) , isDeclared ) ; }
Creates a record . Fails if any duplicate property names were added .