summaryrefslogtreecommitdiff
path: root/src/main/java/com/redstoner/misc/mysql/types/text/Enum.java
blob: 62002922bcb143fb8d5731b51d8b83bc1965f793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.redstoner.misc.mysql.types.text;

import com.redstoner.misc.mysql.types.MysqlType;

public class Enum extends MysqlType {
	private String[] possibleValues;

	public Enum(String... possibleValues) {
		this.possibleValues = possibleValues;
	}

	@Override
	public String getName() {
		String name = "ENUM(";

		for (int i = 0; i < possibleValues.length; i++) {
			name += "'" + possibleValues[i] + "'";

			if (i != possibleValues.length - 1) {
				name += ",";
			}
		}

		return name + ")";
	}

}