Package com.illumon.iris.db.v2.routing
Class SafeCast
java.lang.Object
com.illumon.iris.db.v2.routing.SafeCast
public class SafeCast extends Object
-
Constructor Summary
Constructors Constructor Description SafeCast() -
Method Summary
Modifier and Type Method Description static List<?>toList(Object o, String context)Cast the object to a List if possible, or throw a DataRoutingConfigurationExceptionstatic Map<Object,Object>toMap(Object o, String context)Cast the object to a Map if possible, or throw a DataRoutingConfigurationException
-
Constructor Details
-
SafeCast
public SafeCast()
-
-
Method Details
-
toMap
Cast the object to a Map if possible, or throw a DataRoutingConfigurationException- Parameters:
o- the object to castcontext- context for any exceptions (context is not a Map...)- Returns:
- o cast to a Map
-
toList
Cast the object to a List if possible, or throw a DataRoutingConfigurationException- Parameters:
o- the object to castcontext- context for any exceptions (context is not a List...)- Returns:
- o cast to a List
-