/**
 * Copyright (c) 2016-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */ import * as CLangCommon from './clang-common' ; import * as ObjC from './objc' ; import * as ObjectSpec from './object-spec' ; import * as ObjectGeneration from './object-generation' ; export class AttributeBuilder implements ObjectSpec . Attribute { annotations : ObjectGeneration . AnnotationMap ; comments : string [ ] ; name : string ; nullability : CLangCommon . Nullability ; type : AttributeTypeBuilder ; constructor ( name , type ) { this . name = name ; this . type = type ; this . annotations = { } ; this . comments = [ ] ; this . nullability = CLangCommon . Nullability . Inherited ( ) ; } withAnnotations ( annotations ) { this . annotations = annotations ; return this ; } withComments ( comments ) { this . comments = comments ; return this ; } withNullability ( nullability ) { this . nullability = nullability ; return this ; } asObject ( ) { return { annotations : this . annotations , comments : this . comments , name : this . name , nullability : this . nullability , type : this . type . asObject ( ) } ; } } export class AttributeTypeBuilder implements ObjectSpec . AttributeType { fileTypeIsDefinedIn : string | null ; libraryTypeIsDefinedIn : string | null ; name : string ; reference : string ; underlyingType : string | null ; conformingProtocol : string | null ; referencedGenericTypes : ObjC . ReferencedGenericType [ ] ; constructor ( name , reference , underlyingType ) { this . fileTypeIsDefinedIn = null ; this . libraryTypeIsDefinedIn = null ; this . name = name ; this . reference = reference ; this . underlyingType = underlyingType ; this . conformingProtocol = null ; this . referencedGenericTypes = [ ] ; } withFileTypeIsDefinedIn ( file ) { this . fileTypeIsDefinedIn = file ; return this ; } withLibraryTypeIsDefinedIn ( library ) { this . libraryTypeIsDefinedIn = library ; return this ; } withConformingProtocol ( protocol ) { this . conformingProtocol = protocol ; return this ; } withReferencedGenericTypes ( types ) { this . referencedGenericTypes = types ; return this ; } asObject ( ) { return { fileTypeIsDefinedIn : this . fileTypeIsDefinedIn , libraryTypeIsDefinedIn : this . libraryTypeIsDefinedIn , name : this . name , reference : this . reference , underlyingType : this . underlyingType , conformingProtocol : this . conformingProtocol , referencedGenericTypes : this . referencedGenericTypes } ; } }