Package com.sequenceiq.cloudbreak.converter

Source Code of com.sequenceiq.cloudbreak.converter.MetaDataConverter

package com.sequenceiq.cloudbreak.converter;

import org.springframework.stereotype.Component;

import com.sequenceiq.cloudbreak.controller.json.InstanceMetaDataJson;
import com.sequenceiq.cloudbreak.domain.InstanceMetaData;

@Component
public class MetaDataConverter extends AbstractConverter<InstanceMetaDataJson, InstanceMetaData> {

    @Override
    public InstanceMetaDataJson convert(InstanceMetaData entity) {
        InstanceMetaDataJson metaDataJson = new InstanceMetaDataJson();
        metaDataJson.setPrivateIp(entity.getPrivateIp());
        metaDataJson.setPublicIp(entity.getPublicIp());
        metaDataJson.setVolumeCount(entity.getVolumeCount());
        metaDataJson.setAmbariServer(entity.getAmbariServer());
        metaDataJson.setInstanceId(entity.getInstanceId());
        metaDataJson.setInstanceIndex(entity.getInstanceIndex());
        metaDataJson.setDockerSubnet(entity.getDockerSubnet());
        metaDataJson.setLongName(entity.getLongName());
        metaDataJson.setContainerCount(entity.getContainerCount());
        return metaDataJson;
    }

    @Override
    public InstanceMetaData convert(InstanceMetaDataJson json) {
        throw new UnsupportedOperationException("Instance metadata shouldn't be created from json.");
    }
}
TOP

Related Classes of com.sequenceiq.cloudbreak.converter.MetaDataConverter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.