/*
Copyright (c) 2016 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package org.ovirt.sdk.go;

import java.util.ArrayList;
import java.util.List;

/**
 * This class represents a reference to a Python type, including all the imports that are necessary to use it. For
 * example, if the type reference is {@code types.Vm} and the {@code types} prefix corresponds to the package
 * {@code ovirtsdk4.types} then the list of imports will contain {@code from ovirtsdk4 import types}.
 */
public class GoTypeReference {
    private String text;
    private List<String> imports = new ArrayList<>(1);

    public String getText() {
        return text;
    }

    public void setText(String newText) {
        text = newText;
    }

    public void setText(Class<?> clazz) {
        text = clazz.getSimpleName();
    }

    public List<String> getImports() {
        return new ArrayList<>(imports);
    }

    public void setImports(List<String> newImports) {
        imports.clear();
        imports.addAll(newImports);
    }

    public void addImport(String newImport) {
        imports.add(newImport);
    }

    @Override
    public String toString() {
        return text;
    }
}


@@ -685,14 +685,10 @@
 o a 
-Python
+Go
  typ
@@ -749,224 +749,8 @@
  it.
- For%0A * example, if the type reference is %7B@code types.Vm%7D and the %7B@code types%7D prefix corresponds to the package%0A * %7B@code ovirtsdk4.types%7D then the list of imports will contain %7B@code from ovirtsdk4 import types%7D.
 %0A */

fix some comments.