static String asString ( Object value ) throws ProvidenceConfigException { if ( value instanceof Collection || value instanceof Map ) { throw new ProvidenceConfigException ( "Unable to convert " + value . getClass ( ) . getSimpleName ( ) + " to a string" ) ; } else if ( value instanceof Stringable ) { return ( ( Stringable ) value ) . asString ( ) ; } else if ( value instanceof Date ) { Instant instant = ( ( Date ) value ) . toInstant ( ) ; return DateTimeFormatter . ISO_INSTANT . format ( instant ) ; } return Objects . toString ( value ) ; }
Convert the value to a string .