\r\n

51Degrees IP Intelligence Java  4.5

IP Intelligence services for 51Degrees Pipeline

fiftyone.ipintelligence.examples.shared.PropertyHelper Class Reference

Static Public Member Functions

static< T > AspectPropertyValue< T >  tryGet (Supplier< AspectPropertyValue< T >> supplier)
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 String  asStringProperty (AspectPropertyValue< List< IWeightedValue< String >>> property)
Helper to get the value of an IP Intelligence string list property - strongly typed.
static String  asIntegerProperty (AspectPropertyValue< List< IWeightedValue< Integer >>> property)
Helper to get the value of an IP Intelligence integer list property - strongly typed.
static String  asFloatProperty (AspectPropertyValue< List< IWeightedValue< Float >>> property)
Helper to get the value of an IP Intelligence float list property - strongly typed.
static String  asIPAddressProperty (AspectPropertyValue< List< IWeightedValue< java.net.InetAddress >>> property)
Helper to get the value of an IP Intelligence InetAddress list property - strongly typed.
static< T > String  asString (AspectPropertyValue< T > value)
Generic helper to get the value of a property as a string. More...

Member Function Documentation

◆ asString()

static <T> String fiftyone.ipintelligence.examples.shared.PropertyHelper.asString ( AspectPropertyValue< T >   value )
static

Generic helper to get the value of a property as a string.

Used primarily for testing and simple property display.

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

◆ tryGet()

static <T> AspectPropertyValue<T> fiftyone.ipintelligence.examples.shared.PropertyHelper.tryGet ( Supplier< AspectPropertyValue< T >>   supplier )
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
supplier - to use e.g. IPIntelligenceData::getIsMobile()
Returns
value