package org.jenkinsci.plugins.p4_client.client;
import java.util.ArrayList;
import java.util.List;
public enum CharsetTypes {
EUCJP("eucjp", 20021),
ISO8859_1("iso8859-1", 20042),
ISO8859_5("iso8859-5", 20052),
ISO8859_15("iso8859-15", 20042),
MACOSROMAN("macosroman", 20022),
SHIFTJIS("shiftjis", 20092),
KOI8_R("koi8-r", 20052),
UTF8("utf8", 20021),
UTF8_BOM("utf8-bom", 20052),
UTF16("utf16", 20052),
UTF16_NOBOM("utf16-nobom", 20052),
UTF16LE("utf16le", 20052),
UTF16LE_BOM("utf16le-bom", 20052),
UTF16BE("utf16be", 20052),
UTF16BE_BOM("utf16be-bom", 20052),
UTF32("utf32", 20061),
UTF32_NOBOM("utf32-nobom", 20061),
UTF32LE("utf32le", 20061),
UTF32LE_BOM("utf32le-bom", 20061),
UTF32BE("utf32be", 20061),
UTF32BE_BOM("utf32be-bom", 20061),
CP936("cp936", 20111),
CP949("cp949", 20091),
CP950("cp950", 20111),
CP1251("cp1251", 20052),
WINANSI("winansi", 20021),
NONE("none", 20021);
final String charset;
final int since;
CharsetTypes(String charset, int since) {
this.charset = charset;
this.since = since;
}
public String getCharset() {
return charset;
}
public int getSince() {
return since;
}
public static List<String> getCharsetsSince(int since) {
List<String> types = new ArrayList<String>();
for(CharsetTypes c : CharsetTypes.values()) {
if(c.getSince() <= since) {
types.add(c.getCharset());
}
}
return types;
}
}