class StackInfoMapper {

    public StackInfo map() {
        final StackInfo info = new StackInfo();
        if (stack == null) {
            info.setStatus(HeatStatus.NOTFOUND);
        } else {
            info.setName(stack.getStackName());
            info.setCanonicalName(stack.getStackName() + "/" + stack.getId());
            info.setStatus(this.mapStatus(stack.getStackStatus()));

            info.setStatusMessage(stack.getStackStatusReason());

            Optional<Map<String, Object>> result = this.mapOutputToMap(stack.getOutputs());
            if (result.isPresent()) {
                info.setOutputs(result.get());
            }

            info.setParameters(stack.getParameters());
        }

        return info;
    }

    public  StackInfoMapper(Stack stack);

}