package de.avatic.taricdb.helper.workbook.wrapper;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

import de.avatic.taricdb.model.Import;

public class ImportWrapper {
	
	private CompletableFuture<Import> im;
	
	private String hsCode;
	private String origin;
	private String addCode;
	


	public ImportWrapper(String hsCode, String origin, String addCode) {
		this.hsCode = hsCode;
		this.origin = origin;
		this.addCode = addCode;
		this.im = new CompletableFuture<Import>();
	}

	public Import getImport() {
		
		try {
			return im.get();
		} catch (InterruptedException | ExecutionException e) {
			throw new RuntimeException(e);
		}
	}

	public String getHsCode() {
		return hsCode;
	}

	public String getOrigin() {
		return origin;
	}

	public String getAddCode() {
		return addCode;
	}

	public void completeImport(Import im) {
		this.im.complete(im);
	}

}
