From d57b0c093d421fb0ca7b87c0c98b5a4d57bfc79d Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 2 Mar 2015 16:37:09 -0500 Subject: [PATCH] Document double-to-int behavior, fixes #183 --- config/src/main/java/com/typesafe/config/Config.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/src/main/java/com/typesafe/config/Config.java b/config/src/main/java/com/typesafe/config/Config.java index a09a55c9..72b85d95 100644 --- a/config/src/main/java/com/typesafe/config/Config.java +++ b/config/src/main/java/com/typesafe/config/Config.java @@ -472,6 +472,12 @@ public interface Config extends ConfigMergeable { Number getNumber(String path); /** + * Gets the integer at the given path. If the value at the + * path has a fractional (floating point) component, it + * will be discarded and only the integer part will be + * returned (it works like a "narrowing primitive conversion" + * in the Java language specification). + * * @param path * path expression * @return the 32-bit integer value at the requested path @@ -484,6 +490,12 @@ public interface Config extends ConfigMergeable { int getInt(String path); /** + * Gets the long integer at the given path. If the value at + * the path has a fractional (floating point) component, it + * will be discarded and only the integer part will be + * returned (it works like a "narrowing primitive conversion" + * in the Java language specification). + * * @param path * path expression * @return the 64-bit long value at the requested path