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 * A description of this support type (more information than the
39 * {@link BasicSupport#getSourceName()}).
41 * @return the description
43 public String
getDesc() {
44 String desc
= Instance
.getTrans().getStringX(StringId
.INPUT_DESC
,
48 desc
= Instance
.getTrans().getString(StringId
.INPUT_DESC
, this);
55 * The name of this support type (a short version).
59 public String
getSourceName() {
60 BasicSupport support
= BasicSupport
.getSupport(this, null);
61 if (support
!= null) {
62 return support
.getSourceName();
69 public String
toString() {
70 return super.toString().toLowerCase();
74 * Call {@link SupportType#valueOf(String)} after conversion to upper case.
77 * the possible type name
79 * @return NULL or the type
81 public static SupportType
valueOfUC(String typeName
) {
82 return SupportType
.valueOf(typeName
== null ?
null : typeName
87 * Call {@link SupportType#valueOf(String)} after conversion to upper case
88 * but return NULL for NULL instead of raising exception.
91 * the possible type name
93 * @return NULL or the type
95 public static SupportType
valueOfNullOkUC(String typeName
) {
96 if (typeName
== null) {
100 return SupportType
.valueOfUC(typeName
);
104 * Call {@link SupportType#valueOf(String)} after conversion to upper case
105 * but return NULL in case of error instead of raising an exception.
108 * the possible type name
110 * @return NULL or the type
112 public static SupportType
valueOfAllOkUC(String typeName
) {
114 return SupportType
.valueOfUC(typeName
);
115 } catch (Exception e
) {