de.smartics.properties.api.core.domain
Class PropertiesContext.Builder

Package class diagram package PropertiesContext.Builder
java.lang.Object
  extended by de.smartics.properties.api.core.domain.PropertiesContext.Builder
Enclosing class:
PropertiesContext

public static final class PropertiesContext.Builder
     
     
extends Object

The builder of PropertiesContext.


Constructor Summary
PropertiesContext.Builder()
           
 
Method Summary
 PropertiesContext build()
          Creates the instance.
 PropertiesContext.Builder withAlias(String alias, String physical)
          Adds a new alias to the given physical resource.
 PropertiesContext.Builder withHomePageUrl(String homePageUrl)
          Sets the URL to the home page of the project.
 PropertiesContext.Builder withLocales(List<Locale> locales)
          Sets the list of supported locales.
 PropertiesContext.Builder withPropertiesReportUrl(String propertiesReportUrl)
          Sets the URL to the root directory of smartics properties reports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesContext.Builder

public PropertiesContext.Builder()
Method Detail

withLocales

public PropertiesContext.Builder withLocales(List<Locale> locales)
                                      throws NullPointerException
Sets the list of supported locales. The list contains locales the context provides localized information for.

Parameters:
locales - the list of supported locales.
Returns:
a reference to the builder.
Throws:
NullPointerException - if locales is null.

withHomePageUrl

public PropertiesContext.Builder withHomePageUrl(String homePageUrl)
                                          throws NullPointerException,
                                                 IllegalArgumentException
Sets the URL to the home page of the project.

Parameters:
homePageUrl - the URL to the home page of the project.
Returns:
a reference to the builder.
Throws:
NullPointerException - if homePageUrl is null.
IllegalArgumentException - if homePageUrl is blank.

withPropertiesReportUrl

public PropertiesContext.Builder withPropertiesReportUrl(String propertiesReportUrl)
                                                  throws NullPointerException,
                                                         IllegalArgumentException
Sets the URL to the root directory of smartics properties reports.

Parameters:
propertiesReportUrl - the URL to the root directory of smartics properties reports.
Returns:
a reference to the builder.
Throws:
NullPointerException - if propertiesReportUrl is null.
IllegalArgumentException - if propertiesReportUrl is blank.

withAlias

public PropertiesContext.Builder withAlias(String alias,
                                           String physical)
                                    throws de.smartics.util.lang.BlankArgumentException,
                                           DuplicateAliasException
Adds a new alias to the given physical resource.

Parameters:
alias - the new alias.
physical - the resource the alias refers to.
Returns:
a reference to the builder.
Throws:
de.smartics.util.lang.BlankArgumentException - if either alias or physical is blank.
DuplicateAliasException - if there is already an alias registered that points to a different physical resource.

build

public PropertiesContext build()
Creates the instance.

Returns:
the new instance.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.