summaryrefslogtreecommitdiff
path: root/pdf-over-commons/src/main/java/at/asit
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2020-11-13 13:49:59 +0100
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2020-11-13 13:49:59 +0100
commitd658f95290ea03bd0ecdc01110b48244b28e6f19 (patch)
treeaffd5db6f2a4d4fdbda113aeb1314458aa5f6775 /pdf-over-commons/src/main/java/at/asit
parenta43f3b3f266a63a505ae866a2378f01e5b508cc9 (diff)
downloadpdf-over-d658f95290ea03bd0ecdc01110b48244b28e6f19.tar.gz
pdf-over-d658f95290ea03bd0ecdc01110b48244b28e6f19.tar.bz2
pdf-over-d658f95290ea03bd0ecdc01110b48244b28e6f19.zip
refactored Profile
Diffstat (limited to 'pdf-over-commons/src/main/java/at/asit')
-rw-r--r--pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java
new file mode 100644
index 00000000..84de1aaa
--- /dev/null
+++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java
@@ -0,0 +1,58 @@
+package at.asit.pdfover.commons;
+
+public enum Profile {
+
+ SIGNATURBLOCK("Signaturblock Normal") , //$NON-NLS-1$
+ SIGNATURBLOCK_SMALL("Signaturblock Klein"), //$NON-NLS-1$
+ AMTSSIGNATURBLOCK("Amtssignatur"), //$NON-NLS-1$
+ LOGO_ONLY("Nur Bildmarke"), //$NON-NLS-1$
+ INVISIBLE("Unsichtbar");
+
+ public static int length = 5;
+ private String name;
+
+ Profile(String profile){
+ this.name = profile;
+ }
+
+ public static String[] getProfileStrings() {
+ String[] profiles = new String[Profile.length];
+ int i = 0;
+ for (Profile profile : Profile.values()) {
+ profiles[i] = profile.getName();
+ i++;
+ }
+ return profiles;
+ }
+
+ public static Profile getProfileByIndex(int index) {
+ String[] profiles = getProfileStrings();
+ if (profiles.length < index) {
+ return null;
+ }
+ return getProfile(profiles[index]);
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public static Profile getProfile(String profile) {
+ if (SIGNATURBLOCK.getName().equals(profile)) {
+ return SIGNATURBLOCK;
+ } else if (SIGNATURBLOCK_SMALL.getName().equals(profile)) {
+ return SIGNATURBLOCK_SMALL;
+ } else if (AMTSSIGNATURBLOCK.getName().equals(profile)) {
+ return AMTSSIGNATURBLOCK;
+ } else if (LOGO_ONLY.getName().equals(profile)) {
+ return LOGO_ONLY;
+ } else if (INVISIBLE.getName().equals(profile)){
+ return INVISIBLE;
+ }
+ return null;
+ }
+
+
+
+
+}