Skip to content

Commit 2585e42

Browse files
Update smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSettings.java
Co-authored-by: Adam Thomas <[email protected]>
1 parent 889daeb commit 2585e42

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSettings.java

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -318,25 +318,27 @@ public void setProtocol(ShapeId protocol) {
318318
/**
319319
* An enum indicating the type of artifact the code generator will produce.
320320
*/
321-
public enum ArtifactType {
322-
CLIENT(SymbolVisitor::new),
323-
SSDK((m, s) -> new ServerSymbolVisitor(m, new SymbolVisitor(m, s)));
324-
325-
private final BiFunction<Model, TypeScriptSettings, SymbolProvider> symbolProviderFactory;
326-
327-
ArtifactType(BiFunction<Model, TypeScriptSettings, SymbolProvider> symbolProviderFactory) {
328-
this.symbolProviderFactory = symbolProviderFactory;
321+
public enum ArtifactType {
322+
CLIENT {
323+
@Override
324+
public SymbolProvider createSymbolProvider(Model model, TypeScriptSettings settings) {
325+
return new SymbolVisitor(model, settings);
329326
}
330-
331-
/**
332-
* Creates a TypeScript symbol provider suited to the artifact type.
333-
*
334-
* @param model Model to generate symbols for.
335-
* @param settings Settings used by the symbol provider.
336-
* @return Returns the created provider.
337-
*/
327+
},
328+
SSDK {
329+
@Override
338330
public SymbolProvider createSymbolProvider(Model model, TypeScriptSettings settings) {
339-
return symbolProviderFactory.apply(model, settings);
331+
return new ServerSymbolVisitor(model, new SymbolVisitor(model, settings));
340332
}
341-
}
333+
};
334+
335+
/**
336+
* Creates a TypeScript symbol provider suited to the artifact type.
337+
*
338+
* @param model Model to generate symbols for.
339+
* @param settings Settings used by the symbol provider.
340+
* @return Returns the created provider.
341+
*/
342+
public abstract SymbolProvider createSymbolProvider(Model model, TypeScriptSettings settings);
343+
}
342344
}

0 commit comments

Comments
 (0)