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

io.polaris.builder.code.dto.SchemaDto Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package io.polaris.builder.code.dto;


import io.polaris.core.map.Maps;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
import lombok.*;
import org.apache.commons.lang3.SerializationUtils;

import java.io.Serializable;
import java.util.Map;

/**
 * @author Qt
 */
@SuppressWarnings("ALL")
@Data
@XStreamAlias("schema")
public class SchemaDto implements Serializable {
	private static final long serialVersionUID = 1L;

	@XStreamAlias("name")
	@XStreamAsAttribute
	private String name;

	@ToString.Exclude
	@Getter(AccessLevel.NONE)
	@Setter(AccessLevel.NONE)
	@XStreamAlias("tables")
	@XStreamImplicit(itemFieldName = "table", keyFieldName = "name")
	private Map tables = Maps.newUpperCaseLinkedHashMap();


	public TableDto getTable(String name) {
		return tables.get(name);
	}

	public void addTable(TableDto table) {
		tables.put(table.getName(), table);
	}


	@Override
	public SchemaDto clone() {
		return SerializationUtils.clone(this);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy