net.sf.uadetector.internal.data
Class DataBuilder

java.lang.Object
  extended by net.sf.uadetector.internal.data.DataBuilder

@NotThreadSafe
public class DataBuilder
extends java.lang.Object

This class is intended to create instances of Data.

Author:
André Rouél

Constructor Summary
DataBuilder()
           
 
Method Summary
 DataBuilder appendBrowser(Browser browser)
           
 DataBuilder appendBrowserBuilder(Browser.Builder browserBuilder)
          Appends a copy of the given Browser.Builder to the internal data structure.
 DataBuilder appendBrowserOperatingSystemMapping(BrowserOperatingSystemMapping browserOsMapping)
           
 DataBuilder appendBrowserPattern(BrowserPattern pattern)
          Appends a browser pattern to the map of pattern sorted by ID.
 DataBuilder appendBrowserType(BrowserType type)
           
 DataBuilder appendDevice(Device device)
           
 DataBuilder appendDeviceBuilder(Device.Builder deviceBuilder)
          Appends a copy of the given Device.Builder to the internal data structure.
 DataBuilder appendDevicePattern(DevicePattern pattern)
          Appends a device pattern to the map of pattern sorted by ID.
 DataBuilder appendOperatingSystem(OperatingSystem operatingSystem)
           
 DataBuilder appendOperatingSystemBuilder(OperatingSystem.Builder operatingSystemBuilder)
          Appends a copy of the given OperatingSystem.Builder to the internal data structure.
 DataBuilder appendOperatingSystemPattern(OperatingSystemPattern pattern)
          Appends an operating system pattern to the map of pattern sorted by ID.
 DataBuilder appendRobot(Robot robot)
           
 Data build()
           
 DataBuilder setVersion(java.lang.String version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataBuilder

public DataBuilder()
Method Detail

appendBrowser

public DataBuilder appendBrowser(@Nonnull
                                 Browser browser)

appendBrowserBuilder

@Nonnull
public DataBuilder appendBrowserBuilder(@Nonnull
                                                Browser.Builder browserBuilder)
Appends a copy of the given Browser.Builder to the internal data structure.

Parameters:
browserBuilder - Browser.Builder to be copied and appended
Returns:
this Builder, for chaining
Throws:
net.sf.qualitycheck.exception.IllegalNullArgumentException - if the given argument is null
net.sf.qualitycheck.exception.IllegalStateOfArgumentException - if the ID of the given builder is invalid
net.sf.qualitycheck.exception.IllegalStateOfArgumentException - if a builder with the same ID already exists

appendBrowserOperatingSystemMapping

@Nonnull
public DataBuilder appendBrowserOperatingSystemMapping(@Nonnull
                                                               BrowserOperatingSystemMapping browserOsMapping)

appendBrowserPattern

@Nonnull
public DataBuilder appendBrowserPattern(@Nonnull
                                                BrowserPattern pattern)
Appends a browser pattern to the map of pattern sorted by ID.

Parameters:
pattern - a pattern for a browser
Returns:
itself
Throws:
net.sf.qualitycheck.exception.IllegalNullArgumentException - if the given argument is null

appendBrowserType

@Nonnull
public DataBuilder appendBrowserType(@Nonnull
                                             BrowserType type)

appendDevice

public DataBuilder appendDevice(@Nonnull
                                Device device)

appendDeviceBuilder

@Nonnull
public DataBuilder appendDeviceBuilder(@Nonnull
                                               Device.Builder deviceBuilder)
Appends a copy of the given Device.Builder to the internal data structure.

Parameters:
deviceBuilder - Device.Builder to be copied and appended
Returns:
this Builder, for chaining
Throws:
net.sf.qualitycheck.exception.IllegalNullArgumentException - if the given argument is null
net.sf.qualitycheck.exception.IllegalStateOfArgumentException - if the ID of the given builder is invalid
net.sf.qualitycheck.exception.IllegalStateOfArgumentException - if a builder with the same ID already exists

appendDevicePattern

@Nonnull
public DataBuilder appendDevicePattern(@Nonnull
                                               DevicePattern pattern)
Appends a device pattern to the map of pattern sorted by ID.

Parameters:
pattern - a pattern for a device
Returns:
itself
Throws:
net.sf.qualitycheck.exception.IllegalNullArgumentException - if the given argument is null

appendOperatingSystem

@Nonnull
public DataBuilder appendOperatingSystem(@Nonnull
                                                 OperatingSystem operatingSystem)

appendOperatingSystemBuilder

@Nonnull
public DataBuilder appendOperatingSystemBuilder(@Nonnull
                                                        OperatingSystem.Builder operatingSystemBuilder)
Appends a copy of the given OperatingSystem.Builder to the internal data structure.

Parameters:
operatingSystemBuilder - OperatingSystem.Builder to be copied and appended
Returns:
this Builder, for chaining
Throws:
net.sf.qualitycheck.exception.IllegalNullArgumentException - if the given argument is null
net.sf.qualitycheck.exception.IllegalNegativeArgumentException - if the ID of the given builder is negative
net.sf.qualitycheck.exception.IllegalStateOfArgumentException - if a builder with the same ID already exists

appendOperatingSystemPattern

@Nonnull
public DataBuilder appendOperatingSystemPattern(@Nonnull
                                                        OperatingSystemPattern pattern)
Appends an operating system pattern to the map of pattern sorted by ID.

Parameters:
pattern - a pattern for a browser
Returns:
itself
Throws:
net.sf.qualitycheck.exception.IllegalNullArgumentException - if the pattern is null

appendRobot

@Nonnull
public DataBuilder appendRobot(@Nonnull
                                       Robot robot)

build

@Nonnull
public Data build()

setVersion

@Nonnull
public DataBuilder setVersion(@Nonnull
                                      java.lang.String version)


Copyright © 2011-2014. All Rights Reserved.