From: Roland Haeder Date: Tue, 12 Apr 2016 18:34:17 +0000 (+0200) Subject: Renamed package smsprovider -> mobileprovider. They don't only provide SMS but also... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ef4b5a61bc8bc28907f6bbf248eaaa0ca3e239aa;p=jjobs-war.git Renamed package smsprovider -> mobileprovider. They don't only provide SMS but also many other mobile services. --- diff --git a/lib/jphone-core.jar b/lib/jphone-core.jar index ec8a9b92..251994ea 100644 Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ diff --git a/lib/jphone-lib.jar b/lib/jphone-lib.jar index 2fc3981f..874d4e7a 100644 Binary files a/lib/jphone-lib.jar and b/lib/jphone-lib.jar differ diff --git a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebApplicationBean.java new file mode 100644 index 00000000..85cd9fa1 --- /dev/null +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebApplicationBean.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.jjobs.beans.mobileprovider; + +import java.util.Collections; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; +import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote; + +/** + * A SMS provider bean + *

+ * @author Roland Haeder + */ +@Named ("cellphone") +@ApplicationScoped +public class JobsMobileProviderWebApplicationBean implements JobsMobileProviderWebApplicationController { + + /** + * Serial number + */ + private static final long serialVersionUID = 176_985_298_681_742_960L; + + /** + * Remote country EJB + */ + private MobileProviderSingletonBeanRemote cellphoneBean; + + /** + * List of all countries + */ + private List cellphoneList; + + /** + * Default constructor + */ + public JobsMobileProviderWebApplicationBean () { + // Try this + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup the bean + this.cellphoneBean = (MobileProviderSingletonBeanRemote) context.lookup("java:global/jjobs-ejb/MobileProvider!org.mxchange.jphone.phonenumbers.MobileProvider.MobileProviderSingletonBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw + throw new FaceletException(ex); + } + } + + @Override + public List allMobileProvider () { + // Return "cached" version + return Collections.unmodifiableList(this.cellphoneList); + } + + /** + * Post-initialization of this class + */ + @PostConstruct + public void init () { + this.cellphoneList = this.cellphoneBean.allMobileProvider(); + } +} diff --git a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebApplicationController.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebApplicationController.java new file mode 100644 index 00000000..2263c5e9 --- /dev/null +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebApplicationController.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.jjobs.beans.mobileprovider; + +import java.io.Serializable; +import java.util.List; +import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; + +/** + * An interface for country beans + *

+ * @author Roland Haeder + */ +public interface JobsMobileProviderWebApplicationController extends Serializable { + + /** + * A list of all countries + *

+ * @return All countries + */ + List allMobileProvider (); + +} diff --git a/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationBean.java deleted file mode 100644 index 32c4ad51..00000000 --- a/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationBean.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2016 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package org.mxchange.jjobs.beans.smsprovider; - -import java.util.Collections; -import java.util.List; -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.faces.view.facelets.FaceletException; -import javax.inject.Named; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jphone.phonenumbers.smsprovider.MobileProviderSingletonBeanRemote; -import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider; - -/** - * A SMS provider bean - *

- * @author Roland Haeder - */ -@Named ("cellphone") -@ApplicationScoped -public class JobsMobileProviderWebApplicationBean implements JobsMobileProviderWebApplicationController { - - /** - * Serial number - */ - private static final long serialVersionUID = 176_985_298_681_742_960L; - - /** - * Remote country EJB - */ - private MobileProviderSingletonBeanRemote cellphoneBean; - - /** - * List of all countries - */ - private List cellphoneList; - - /** - * Default constructor - */ - public JobsMobileProviderWebApplicationBean () { - // Try this - try { - // Get initial context - Context context = new InitialContext(); - - // Try to lookup the bean - this.cellphoneBean = (MobileProviderSingletonBeanRemote) context.lookup("java:global/jjobs-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.MobileProviderSingletonBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw - throw new FaceletException(ex); - } - } - - @Override - public List allMobileProvider () { - // Return "cached" version - return Collections.unmodifiableList(this.cellphoneList); - } - - /** - * Post-initialization of this class - */ - @PostConstruct - public void init () { - this.cellphoneList = this.cellphoneBean.allMobileProvider(); - } -} diff --git a/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationController.java b/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationController.java deleted file mode 100644 index 3a30af02..00000000 --- a/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationController.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2016 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package org.mxchange.jjobs.beans.smsprovider; - -import java.io.Serializable; -import java.util.List; -import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider; - -/** - * An interface for country beans - *

- * @author Roland Haeder - */ -public interface JobsMobileProviderWebApplicationController extends Serializable { - - /** - * A list of all countries - *

- * @return All countries - */ - List allMobileProvider (); -} diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java index 323129c9..2e6e1265 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java @@ -39,6 +39,7 @@ import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.fax.FaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; +import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNotFoundException; @@ -48,7 +49,6 @@ import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; import org.mxchange.jusercore.model.user.UserUtils; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; -import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider; /** * A user bean (controller) diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionController.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionController.java index c615324d..23345a64 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionController.java @@ -21,10 +21,10 @@ import java.util.Date; import java.util.List; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcountry.data.Country; +import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; -import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider; /** * An interface for user beans diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java index 8f5dba3d..0a65992e 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java @@ -35,12 +35,14 @@ import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.contact.UserContact; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcountry.data.Country; +import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController; import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber; import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.fax.FaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; +import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.jusercore.events.login.UserLoggedInEvent; import org.mxchange.jusercore.events.registration.UserRegisteredEvent; import org.mxchange.jusercore.exceptions.UserNotFoundException; @@ -49,8 +51,6 @@ import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; -import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController; -import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider; /** * A user bean (controller) diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java index 7b72a005..092f904b 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java @@ -21,12 +21,12 @@ import java.util.Date; import java.util.List; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcountry.data.Country; +import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.jusercore.events.login.UserLoggedInEvent; import org.mxchange.jusercore.events.registration.UserRegisteredEvent; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; -import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider; /** * An interface for user beans diff --git a/src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java b/src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java new file mode 100644 index 00000000..9e765ee5 --- /dev/null +++ b/src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.jjobs.converter.mobileprovider; + +import java.text.MessageFormat; +import java.util.List; +import java.util.Objects; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.FacesConverter; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcoreeelogger.beans.local.logger.Log; +import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; +import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; +import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote; + +/** + * Converter for SMS provider instance + *

+ * @author Roland Haeder + */ +@FacesConverter (value = "cellphoneCarrier") +public class JobsMobileProviderConverter implements Converter { + + /** + * Logger instance + */ + @Log + private LoggerBeanLocal loggerBeanLocal; + + /** + * SMS provider bean + */ + private MobileProviderSingletonBeanRemote providerController; + + /** + * Initialization of this converter + */ + public JobsMobileProviderConverter () { + // Try to get it + try { + // Get initial context + Context context = new InitialContext(); + + // Lookup logger + this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N + + /// and SMS provider controller + this.providerController = (MobileProviderSingletonBeanRemote) context.lookup("java:global/jjobs-ejb/MobileProvider!org.mxchange.jphone.phonenumbers.MobileProvider.MobileProviderSingletonBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N + } + } + + @Override + public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { + // Trace message + this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N + + // Is the value null or empty? + if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { + // Trace message + this.loggerBeanLocal.logTrace("getAsObject: submittedValue is null or empty - EXIT!"); //NOI18N + + // Return null + return null; + } + + // Get full list + List providerList = this.providerController.allMobileProvider(); + + // Init value + MobileProvider provider = null; + + // Try this better + try { + // Convert it to long + Long providerId = Long.parseLong(submittedValue); + + // Category id should not be below 1 + assert (providerId > 0) : "providerId is smaller than one: " + providerId; //NOI18N + + // Debug message + this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: providerId={0}", providerId)); //NOI18N + + // Try to find it + for (final MobileProvider prov : providerList) { + // Is the id the same? (null-safe) + if (Objects.equals(prov.getProviderId(), providerId)) { + // Found it + provider = prov; + break; + } + } + } catch (final NumberFormatException ex) { + // Log exception (maybe to much?) + this.loggerBeanLocal.logException(ex); + } + + // Trace message + this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: provider={0} - EXIT!", provider)); //NOI18N + + // Return it + return provider; + } + + @Override + public String getAsString (final FacesContext context, final UIComponent component, final Object value) { + // Is the object null? + if ((null == value) || ((String.valueOf(value)).isEmpty())) { + // Is null + return ""; //NOI18N + } else if (!(value instanceof MobileProvider)) { + // Not same interface + throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement MobileProvider.", value)); //NOI18N + } + + // Return category id + return String.valueOf(((MobileProvider) value).getProviderId()); + } + +} diff --git a/src/java/org/mxchange/jjobs/converter/smsprovider/JobsMobileProviderConverter.java b/src/java/org/mxchange/jjobs/converter/smsprovider/JobsMobileProviderConverter.java deleted file mode 100644 index 53e4be8e..00000000 --- a/src/java/org/mxchange/jjobs/converter/smsprovider/JobsMobileProviderConverter.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2016 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package org.mxchange.jjobs.converter.smsprovider; - -import java.text.MessageFormat; -import java.util.List; -import java.util.Objects; -import javax.faces.component.UIComponent; -import javax.faces.context.FacesContext; -import javax.faces.convert.Converter; -import javax.faces.convert.FacesConverter; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcoreeelogger.beans.local.logger.Log; -import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; -import org.mxchange.jphone.phonenumbers.smsprovider.MobileProviderSingletonBeanRemote; -import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider; - -/** - * Converter for SMS provider instance - *

- * @author Roland Haeder - */ -@FacesConverter (value = "cellphoneCarrier") -public class JobsMobileProviderConverter implements Converter { - - /** - * Logger instance - */ - @Log - private LoggerBeanLocal loggerBeanLocal; - - /** - * SMS provider bean - */ - private MobileProviderSingletonBeanRemote providerController; - - /** - * Initialization of this converter - */ - public JobsMobileProviderConverter () { - // Try to get it - try { - // Get initial context - Context context = new InitialContext(); - - // Lookup logger - this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N - - /// and SMS provider controller - this.providerController = (MobileProviderSingletonBeanRemote) context.lookup("java:global/jjobs-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.MobileProviderSingletonBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } - } - - @Override - public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { - // Trace message - this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N - - // Is the value null or empty? - if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { - // Trace message - this.loggerBeanLocal.logTrace("getAsObject: submittedValue is null or empty - EXIT!"); //NOI18N - - // Return null - return null; - } - - // Get full list - List providerList = this.providerController.allMobileProvider(); - - // Init value - MobileProvider provider = null; - - // Try this better - try { - // Convert it to long - Long providerId = Long.parseLong(submittedValue); - - // Category id should not be below 1 - assert (providerId > 0) : "providerId is smaller than one: " + providerId; //NOI18N - - // Debug message - this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: providerId={0}", providerId)); //NOI18N - - // Try to find it - for (final MobileProvider prov : providerList) { - // Is the id the same? (null-safe) - if (Objects.equals(prov.getProviderId(), providerId)) { - // Found it - provider = prov; - break; - } - } - } catch (final NumberFormatException ex) { - // Log exception (maybe to much?) - this.loggerBeanLocal.logException(ex); - } - - // Trace message - this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: provider={0} - EXIT!", provider)); //NOI18N - - // Return it - return provider; - } - - @Override - public String getAsString (final FacesContext context, final UIComponent component, final Object value) { - // Is the object null? - if ((null == value) || ((String.valueOf(value)).isEmpty())) { - // Is null - return ""; //NOI18N - } else if (!(value instanceof MobileProvider)) { - // Not same interface - throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement MobileProvider.", value)); //NOI18N - } - - // Return category id - return String.valueOf(((MobileProvider) value).getProviderId()); - } - -}