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

io.hyperfoil.tools.horreum.mapper.TestTokenMapper Maven / Gradle / Ivy

There is a newer version: 0.15.3
Show newest version
package io.hyperfoil.tools.horreum.mapper;

import io.hyperfoil.tools.horreum.api.data.TestToken;
import io.hyperfoil.tools.horreum.entity.data.TestTokenDAO;

public class TestTokenMapper {
    public static TestToken from(TestTokenDAO tt) {
        TestToken dto = new TestToken();
        dto.id = tt.id;
        dto.testId = tt.test.id;
        dto.permissions = tt.permissions;
        dto.description = tt.description;
        dto.setValue(tt.getValue());

        return dto;
    }

    public static TestTokenDAO to(TestToken dto) {
        TestTokenDAO tt = new TestTokenDAO();
        tt.id = dto.id;
        //tt.test.id = dto.testId; these are lazy loaded so ignoring for now
        tt.permissions = dto.permissions;
        tt.description = dto.description;
        tt.setValue(dto.getValue());

        return tt;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy