]> git.mxchange.org Git - addressbook-war.git/blobdiff - src/java/org/mxchange/addressbook/beans/features/AddressbookFeatureWebApplicationBean.java
Updated copyright year
[addressbook-war.git] / src / java / org / mxchange / addressbook / beans / features / AddressbookFeatureWebApplicationBean.java
index 3de5b295edd0c490c43eaa222b6b26f295a90884..60f0031a6948c65757fc49e3f6b8dd481629ac74 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2024 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
  */
 package org.mxchange.addressbook.beans.features;
 
-import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Named;
-import org.mxchange.addressbook.beans.BaseAddressbookController;
+import org.mxchange.addressbook.beans.BaseAddressbookBean;
 
 /**
  * A feature bean
@@ -28,7 +27,7 @@ import org.mxchange.addressbook.beans.BaseAddressbookController;
  */
 @Named ("featureController")
 @ApplicationScoped
-public class AddressbookFeatureWebApplicationBean extends BaseAddressbookController implements AddressbookFeaturesWebApplicationController {
+public class AddressbookFeatureWebApplicationBean extends BaseAddressbookBean implements AddressbookFeaturesWebApplicationController {
 
        /**
         * Serial number
@@ -43,13 +42,6 @@ public class AddressbookFeatureWebApplicationBean extends BaseAddressbookControl
                super();
        }
 
-       /**
-        * Post-construction method
-        */
-       @PostConstruct
-       public void init () {
-       }
-
        @Override
        public boolean isFeatureEnabled (final String feature) {
                // The parameter must be set
@@ -61,18 +53,11 @@ public class AddressbookFeatureWebApplicationBean extends BaseAddressbookControl
                        throw new IllegalArgumentException("feature is empty"); //NOI18N
                }
 
-               // Default is not enabled
-               boolean isEnabled = false;
-
                // Get value from property
-               String contextParameter = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N
-               //System.out.println(MessageFormat.format("isFeatureSet: feature={0},contextParameter[]={1}", feature, Objects.toString(contextParameter))); //NOI18N
+               final String contextParameter = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N
 
-               // Is the context parameter found?
-               if (contextParameter instanceof String) {
-                       // Is it set?
-                       isEnabled = (Boolean.parseBoolean(contextParameter) == Boolean.TRUE);
-               }
+               // Default is not enabled
+               final boolean isEnabled = Boolean.parseBoolean(contextParameter);
 
                // Return status
                return isEnabled;