\r\n

51Degrees Device Detection Java  4.3

Device detection services for 51Degrees Pipeline

fiftyone.devicedetection.examples.web.ExampleHelper Class Reference

Collaboration diagram for fiftyone.devicedetection.examples.web.ExampleHelper:

[legend]

Classes

interface  PropertyGetter

Static Public Member Functions

static< T > AspectPropertyValue< T >  tryGet (PropertyGetter< T > getter)
Try to carry out a 'get' on a property getter, and catch a PropertyMissingException to avoid the example breaking if the resource key, or data file are not configured correctly by the user. More...
static< T > String  asString (AspectPropertyValue< T > property)
Helper to get the value of a property as a string. More...
static String  getResourceKey ()
Obtain a resource key either from environment variable or from a property.
static String  getResourceKey (String resourceKey)
Obtain a resource key from the passed argument, from environment variable or from a property.

Member Function Documentation

◆ asString()

static <T> String fiftyone.devicedetection.examples.web.ExampleHelper.asString ( AspectPropertyValue< T >   property )
static

Helper to get the value of a property as a string.

Parameters
property - the property value
<T> - the type
Returns
a string representation of the value or a "no value" message

◆ tryGet()

static <T> AspectPropertyValue<T> fiftyone.devicedetection.examples.web.ExampleHelper.tryGet ( PropertyGetter< T >   getter )
static

Try to carry out a 'get' on a property getter, and catch a PropertyMissingException to avoid the example breaking if the resource key, or data file are not configured correctly by the user.

Parameters
getter - to use e.g. DeviceData::getIsMobile()
Returns
value