1 package com.atlassian.dbexporter;
2
3 import java.util.Collection;
4 import java.util.List;
5
6 import static com.google.common.base.Preconditions.checkNotNull;
7 import static com.google.common.collect.Lists.newLinkedList;
8 import static java.util.Collections.unmodifiableCollection;
9 import static java.util.Collections.unmodifiableList;
10
11 public final class Table {
12 private final String name;
13 private final List<Column> columns;
14 private final Collection<ForeignKey> foreignKeys;
15
16 public Table(String name, List<Column> columns, Collection<ForeignKey> foreignKeys) {
17 this.name = checkNotNull(name);
18 this.columns = newLinkedList(checkNotNull(columns));
19 this.foreignKeys = newLinkedList(checkNotNull(foreignKeys));
20 }
21
22 public String getName() {
23 return name;
24 }
25
26 public List<Column> getColumns() {
27 return unmodifiableList(columns);
28 }
29
30 public Collection<ForeignKey> getForeignKeys() {
31 return unmodifiableCollection(foreignKeys);
32 }
33 }