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 */
36 * A description of this support type (more information than the
37 * {@link BasicSupport#getSourceName()}).
39 * @return the description
41 public String
getDesc() {
42 String desc
= Instance
.getTrans().getStringX(StringId
.INPUT_DESC
,
46 desc
= Instance
.getTrans().getString(StringId
.INPUT_DESC
, this);
53 * The name of this support type (a short version).
57 public String
getSourceName() {
58 BasicSupport support
= BasicSupport
.getSupport(this, null);
59 if (support
!= null) {
60 return support
.getSourceName();
67 public String
toString() {
68 return super.toString().toLowerCase();
72 * Call {@link SupportType#valueOf(String)} after conversion to upper case.
75 * the possible type name
77 * @return NULL or the type
79 public static SupportType
valueOfUC(String typeName
) {
80 return SupportType
.valueOf(typeName
== null ?
null : typeName
85 * Call {@link SupportType#valueOf(String)} after conversion to upper case
86 * but return NULL for NULL instead of raising exception.
89 * the possible type name
91 * @return NULL or the type
93 public static SupportType
valueOfNullOkUC(String typeName
) {
94 if (typeName
== null) {
98 return SupportType
.valueOfUC(typeName
);
102 * Call {@link SupportType#valueOf(String)} after conversion to upper case
103 * but return NULL in case of error instead of raising an exception.
106 * the possible type name
108 * @return NULL or the type
110 public static SupportType
valueOfAllOkUC(String typeName
) {
112 return SupportType
.valueOfUC(typeName
);
113 } catch (Exception e
) {