// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java
// public class TypeConverterException extends RuntimeException {
//     private static final long serialVersionUID = -7577535992947276304L;
//     public TypeConverterException(String message) {
//         super(message);
//     }
// }


import com.nordea.oss.copybook.exceptions.TypeConverterException;
import java.util.HashMap;
import java.util.Map;
/*
 * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk>
 * Copyright (c) 2016. Nordea Bank AB
 * Licensed under the MIT license (LICENSE.txt)
 */

package com.nordea.oss.copybook.converters;



public class StringToTypeConverterStringEnum extends StringToString {
    Class<?> type;
    Object[] enumConstants;
    Map<String,Object> toEnumMap = new HashMap<>();
    Map<Object,byte[]> fromEnumMap = new HashMap<>();

    @Override
    public void validate(Class<?> type, int size, int decimals) {
        if(!(TypeConverterStringEnum.class.isAssignableFrom(type))) {
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java
// public class TypeConverterException extends RuntimeException {
//     private static final long serialVersionUID = -7577535992947276304L;
//     public TypeConverterException(String message) {
//         super(message);
//     }
// }


// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/StringToTypeConverterStringEnum.java
import com.nordea.oss.copybook.exceptions.TypeConverterException;
import java.util.HashMap;
import java.util.Map;

/*
 * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk>
 * Copyright (c) 2016. Nordea Bank AB
 * Licensed under the MIT license (LICENSE.txt)
 */

package com.nordea.oss.copybook.converters;



public class StringToTypeConverterStringEnum extends StringToString {
    Class<?> type;
    Object[] enumConstants;
    Map<String,Object> toEnumMap = new HashMap<>();
    Map<Object,byte[]> fromEnumMap = new HashMap<>();

    @Override
    public void validate(Class<?> type, int size, int decimals) {
        if(!(TypeConverterStringEnum.class.isAssignableFrom(type))) {
            throw new TypeConverterException("Only supports converting to and from an Enum that implements TypeConverterStringEnum");