package com.jojubanking.boot.module.infra.convert.redis;

import com.jojubanking.boot.framework.redis.core.RedisKeyDefine;
import com.jojubanking.boot.framework.redis.core.RedisKeyDefine.KeyTypeEnum;
import com.jojubanking.boot.framework.redis.core.RedisKeyDefine.TimeoutTypeEnum;
import com.jojubanking.boot.module.infra.controller.admin.redis.vo.RedisKeyDefineRespVO;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2025-12-05T11:31:57+0800",
    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_201 (Oracle Corporation)"
)
public class RedisConvertImpl implements RedisConvert {

    @Override
    public List<RedisKeyDefineRespVO> convertList(List<RedisKeyDefine> list) {
        if ( list == null ) {
            return null;
        }

        List<RedisKeyDefineRespVO> list1 = new ArrayList<RedisKeyDefineRespVO>( list.size() );
        for ( RedisKeyDefine redisKeyDefine : list ) {
            list1.add( redisKeyDefineToRedisKeyDefineRespVO( redisKeyDefine ) );
        }

        return list1;
    }

    protected RedisKeyDefineRespVO redisKeyDefineToRedisKeyDefineRespVO(RedisKeyDefine redisKeyDefine) {
        if ( redisKeyDefine == null ) {
            return null;
        }

        String keyTemplate = null;
        KeyTypeEnum keyType = null;
        Class<?> valueType = null;
        TimeoutTypeEnum timeoutType = null;
        Duration timeout = null;
        String memo = null;

        keyTemplate = redisKeyDefine.getKeyTemplate();
        keyType = redisKeyDefine.getKeyType();
        valueType = redisKeyDefine.getValueType();
        timeoutType = redisKeyDefine.getTimeoutType();
        timeout = redisKeyDefine.getTimeout();
        memo = redisKeyDefine.getMemo();

        RedisKeyDefineRespVO redisKeyDefineRespVO = new RedisKeyDefineRespVO( keyTemplate, keyType, valueType, timeoutType, timeout, memo );

        return redisKeyDefineRespVO;
    }
}
