Package net.sf.uadetector.ReadableDeviceCategory

Examples of net.sf.uadetector.ReadableDeviceCategory.Category


public class DeviceHashCodeBuilderTest {

  protected static final Device create() {
    final String name = "device name";
    final int id = 1;
    final Category category = Category.PERSONAL_COMPUTER;
    final String icon = "icon";
    final String infoUrl = "info url";
    final SortedSet<DevicePattern> patterns = new TreeSet<DevicePattern>();
    patterns.add(new DevicePattern(1, Pattern.compile("[0-9]"), 1));
    patterns.add(new DevicePattern(2, Pattern.compile("[a-z]"), 2));
View Full Code Here


    // classification depends on matching order
    for (final Entry<DevicePattern, Device> entry : data.getPatternToDeviceMap().entrySet()) {
      final Matcher matcher = entry.getKey().getPattern().matcher(builder.getUserAgentString());
      if (matcher.find()) {
        final Category category = Category.evaluate(entry.getValue().getName());
        final DeviceCategory deviceCategory = findDeviceCategoryByValue(category, data);
        builder.setDeviceCategory(deviceCategory);
        return;
      }
    }
View Full Code Here

TOP

Related Classes of net.sf.uadetector.ReadableDeviceCategory.Category

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.