1 package be
.nikiroo
.fanfix
.supported
;
3 import be
.nikiroo
.fanfix
.Instance
;
4 import be
.nikiroo
.fanfix
.bundles
.StringId
;
7 * The supported input types for which we can get a {@link BasicSupport} object.
11 public enum SupportType
{
12 /** EPUB files created with this program */
14 /** Pure text file with some rules */
16 /** TEXT but with associated .info file */
18 /** My Little Pony fanfictions */
20 /** Fanfictions from a lot of different universes */
22 /** Website with lots of Mangas */
24 /** Furry website with comics support */
26 /** Furry website with stories */
28 /** Comics and images groups, mostly but not only NSFW */
30 /** Website with lots of Mangas, in French */
38 * The name of this support type (a short version).
42 public String
getSourceName() {
49 return "e-hentai.org";
53 return "Fanfiction.net";
55 return "FimFiction.net";
74 * A description of this support type (more information than
75 * {@link SupportType#getSourceName()}).
77 * @return the description
79 public String
getDesc() {
80 String desc
= Instance
.getInstance().getTrans().getStringX(StringId
.INPUT_DESC
, this.name());
83 desc
= Instance
.getInstance().getTrans().getString(StringId
.INPUT_DESC
, this);
90 public String
toString() {
91 return super.toString().toLowerCase();
95 * Call {@link SupportType#valueOf(String)} after conversion to upper case.
98 * the possible type name
100 * @return NULL or the type
102 public static SupportType
valueOfUC(String typeName
) {
103 return SupportType
.valueOf(typeName
== null ?
null : typeName
108 * Call {@link SupportType#valueOf(String)} after conversion to upper case
109 * but return NULL for NULL instead of raising exception.
112 * the possible type name
114 * @return NULL or the type
116 public static SupportType
valueOfNullOkUC(String typeName
) {
117 if (typeName
== null) {
121 return SupportType
.valueOfUC(typeName
);
125 * Call {@link SupportType#valueOf(String)} after conversion to upper case
126 * but return NULL in case of error instead of raising an exception.
129 * the possible type name
131 * @return NULL or the type
133 public static SupportType
valueOfAllOkUC(String typeName
) {
135 return SupportType
.valueOfUC(typeName
);
136 } catch (Exception e
) {