package org.mxchange.pizzaapplication.beans.contact;
import java.text.MessageFormat;
+import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
}
@Override
- @SuppressWarnings ("ReturnOfCollectionOrArrayField")
public List<Contact> allContacts () {
// Debug message
/* NOISY-DEBUG: */ System.out.println(MessageFormat.format("ContactController.allContacts: contactList.size()={0} - EXIT!", this.contactList.size()));
// Return un-modified list
- return this.contactList;
+ return Collections.unmodifiableList(this.contactList);
}
@Override
@Override
public boolean hasContacts () {
- return (!this.allContacts().isEmpty());
+ return (!this.contactList.isEmpty());
}
/**
package org.mxchange.pizzaapplication.beans.country;
import java.text.MessageFormat;
+import java.util.Collections;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
}
@Override
- @SuppressWarnings ("ReturnOfCollectionOrArrayField")
public List<Country> allCountries () {
// Return "cached" version
- return this.countryList;
+ return Collections.unmodifiableList(this.countryList);
}
/**
return "admin_list_mobile_provider"; //NOI18N
}
- @Override
- public List<MobileProvider> allMobileProvider () {
- return this.mobileController.allMobileProvider();
- }
-
@Override
public Country getProviderCountry () {
return this.providerCountry;
this.providerName = providerName;
}
- @Override
- public boolean hasMobileProvider () {
- return (!this.allMobileProvider().isEmpty());
- }
-
/**
* Clears this bean
*/
boolean isFound = false;
// Get list of all providers
- List<MobileProvider> providers = this.allMobileProvider();
+ List<MobileProvider> providers = this.mobileController.allMobileProvider();
// Get iterator from it
Iterator<MobileProvider> iterator = providers.iterator();
package org.mxchange.pizzaapplication.beans.mobileprovider;
import java.io.Serializable;
-import java.util.List;
import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
/**
* An interface for a request web controller (bean) for administrative mobile
*/
String addMobileProvider ();
- /**
- * Returns a list of all mobile providers
- * <p>
- * @return A list of all mobile providers
- */
- List<MobileProvider> allMobileProvider ();
-
- /**
- * Checks whether mobile providers are registered
- * <p>
- * @return Whether mobile providers are registered
- */
- boolean hasMobileProvider ();
-
/**
* Getter for provider dial prefix
* <p>
package org.mxchange.pizzaapplication.beans.mobileprovider;
import java.text.MessageFormat;
+import java.util.Collections;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
-@Named ("mobileController")
+@Named ("mobileProviderController")
@SessionScoped
public class PizzaMobileProviderWebRequestBean implements PizzaMobileProviderWebRequestController {
}
@Override
- @SuppressWarnings ("ReturnOfCollectionOrArrayField")
public List<MobileProvider> allMobileProvider () {
- return this.mobileProviders;
+ return Collections.unmodifiableList(this.mobileProviders);
+ }
+
+ @Override
+ public boolean hasMobileProvider () {
+ return (!this.mobileProviders.isEmpty());
}
/**
*/
List<MobileProvider> allMobileProvider ();
+ /**
+ * Checks whether mobile providers are registered
+ * <p>
+ * @return Whether mobile providers are registered
+ */
+ boolean hasMobileProvider ();
+
/**
* Observes events being fired after the administrator has added a new
* mobile provider
List<User> allUsers = this.allUsers();
// Get all contacts
- List<Contact> allContacts = this.contactController.allContacts();
+ List<Contact> allContacts = this.contactBean.getAllContacts();
// Get iterator
Iterator<Contact> iterator = allContacts.iterator();
<ui:fragment rendered="#{not empty targetController}">
<h:selectOneMenu styleClass="select" id="cellphoneCarrier" value="#{targetController.cellphoneCarrier}" converter="MobileProviderConverter">
<f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{mobileController.allMobileProvider()}" var="p" itemValue="#{p}" itemLabel="#{p.providerCountry.countryExternalDialPrefix}#{p.providerDialPrefix} (#{p.providerName})" />
+ <f:selectItems value="#{mobileProviderController.allMobileProvider()}" var="p" itemValue="#{p}" itemLabel="#{p.providerCountry.countryExternalDialPrefix}#{p.providerDialPrefix} (#{p.providerName})" />
</h:selectOneMenu>
<h:inputText styleClass="input" id="cellphoneNumber" size="10" maxlength="20" value="#{targetController.cellphoneNumber}">
</ui:define>
<ui:define name="content">
- <h:dataTable id="table_list_mobile" var="mobile" value="#{adminMobileProviderController.allMobileProvider()}" styleClass="table_medium" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS}" rendered="#{adminMobileProviderController.hasMobileProvider()}">
+ <h:dataTable id="table_list_mobile" var="mobile" value="#{mobileProviderController.allMobileProvider()}" styleClass="table_medium" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS}" rendered="#{mobileProviderController.hasMobileProvider()}">
<h:column>
<f:facet name="header">#{msg.ADMIN_LIST_MOBILE_PROVIDER_ID}</f:facet>