// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java
// abstract public class AbstractNamedType extends AbstractType {
// 
// 	protected final String name;
// 
// 	public AbstractNamedType(String className) {
// 		this.name = className;
// 	}
// 
// 	@Override
// 	public void write(Writer writer) throws IOException {
// 		writer.write(name);
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void writeDef(Writer writer, WriterPreferences preferences) throws IOException {
// 		if(!preferences.hasCustomWriter(this)) {
// 			writeDefInternal(writer, preferences);
// 		} else {
// 			preferences.writeDef(this, writer);
// 		}
// 	}
// 
// 	abstract public void writeDefInternal(Writer writer, WriterPreferences preferences) throws IOException;
// }


import java.io.IOException;
import java.io.Writer;
import java.util.List;
import java2typescript.jackson.module.grammar.EnumType;
import java2typescript.jackson.module.grammar.base.AbstractNamedType;
package java2typescript.jackson.module.writer;



/**
 * Alternative to writing Java enum type to TypeScript enum type. Usefult, if You have following goals:<br>
 * 1) JavaScript object containing field of "enum" must contain enum name instead of ordinal value. This is good for several reasons: a) easy to understand JSON content b) doesn't mess things up, if enum order changes in backend.<br>
 * 2) You'd still like to write TypeScript as if You were using real enums - type safety, etc.<br>
 * 3) You need to use "reflection" (instanceof) to detect if field is "enum"
 * @author Ats Uiboupin
 */
public class EnumTypeToEnumPatternWriter implements CustomAbstractTypeWriter {

	@Override
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java
// abstract public class AbstractNamedType extends AbstractType {
// 
// 	protected final String name;
// 
// 	public AbstractNamedType(String className) {
// 		this.name = className;
// 	}
// 
// 	@Override
// 	public void write(Writer writer) throws IOException {
// 		writer.write(name);
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void writeDef(Writer writer, WriterPreferences preferences) throws IOException {
// 		if(!preferences.hasCustomWriter(this)) {
// 			writeDefInternal(writer, preferences);
// 		} else {
// 			preferences.writeDef(this, writer);
// 		}
// 	}
// 
// 	abstract public void writeDefInternal(Writer writer, WriterPreferences preferences) throws IOException;
// }


// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/writer/EnumTypeToEnumPatternWriter.java
import java.io.IOException;
import java.io.Writer;
import java.util.List;
import java2typescript.jackson.module.grammar.EnumType;
import java2typescript.jackson.module.grammar.base.AbstractNamedType;

package java2typescript.jackson.module.writer;



/**
 * Alternative to writing Java enum type to TypeScript enum type. Usefult, if You have following goals:<br>
 * 1) JavaScript object containing field of "enum" must contain enum name instead of ordinal value. This is good for several reasons: a) easy to understand JSON content b) doesn't mess things up, if enum order changes in backend.<br>
 * 2) You'd still like to write TypeScript as if You were using real enums - type safety, etc.<br>
 * 3) You need to use "reflection" (instanceof) to detect if field is "enum"
 * @author Ats Uiboupin
 */
public class EnumTypeToEnumPatternWriter implements CustomAbstractTypeWriter {

	@Override
	public boolean accepts(AbstractNamedType type, WriterPreferences preferences) {