All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.saphyra.randwo.item.service.NewKeySaverService Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package com.github.saphyra.randwo.item.service;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import org.springframework.stereotype.Component;

import com.github.saphyra.randwo.key.service.create.CreateKeyService;
import lombok.RequiredArgsConstructor;

@Component
@RequiredArgsConstructor
public class NewKeySaverService {
    private final CreateKeyService createKeyService;

    public Map saveKeys(Map newKeyValues) {

        Map result = new HashMap<>();
        for (Map.Entry newKeyValue : newKeyValues.entrySet()) {
            UUID newKeyId = createKeyService.createKey(newKeyValue.getKey());
            result.put(newKeyId, newKeyValue.getValue());
        }
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy