test_class.file: http-service/src/test/java/net/runelite/http/service/config/ConfigServiceTest.java
test_class.identifier: ConfigServiceTest
test_case.body: @Test
  	public void testParseJsonString()
  	{
  		assertEquals(1, ConfigService.parseJsonString("1"));
  		assertEquals(3.14, ConfigService.parseJsonString("3.14"));
  		assertEquals(1L << 32, ConfigService.parseJsonString("4294967296"));
  		assertEquals("test", ConfigService.parseJsonString("test"));
  		assertEquals("test", ConfigService.parseJsonString("\"test\""));
  		assertEquals(ImmutableMap.of("key", "value"), ConfigService.parseJsonString("{\"key\": \"value\"}"));
  	}
test_case.class_method_signature: ConfigServiceTest.testParseJsonString()
test_case.full_signature: @Test public void testParseJsonString()
test_case.identifier: testParseJsonString
test_case.invocations: assertEquals parseJsonString assertEquals parseJsonString assertEquals parseJsonString assertEquals parseJsonString assertEquals parseJsonString assertEquals of parseJsonString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParseJsonString()
focal_class.declarator: MAX_DEPTH = 8
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_DEPTH = 8;
focal_class.type: int
focal_class.var_name: MAX_DEPTH
focal_class.declarator: MAX_VALUE_LENGTH = 262144
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_VALUE_LENGTH = 262144;
focal_class.type: int
focal_class.var_name: MAX_VALUE_LENGTH
focal_class.declarator: GSON = RuneLiteAPI.GSON
focal_class.modifier: private final
focal_class.original_string: private final Gson GSON = RuneLiteAPI.GSON;
focal_class.type: Gson
focal_class.var_name: GSON
focal_class.declarator: upsertUpdateOptions = new UpdateOptions().upsert(true)
focal_class.modifier: private final
focal_class.original_string: private final UpdateOptions upsertUpdateOptions = new UpdateOptions().upsert(true);
focal_class.type: UpdateOptions
focal_class.var_name: upsertUpdateOptions
focal_class.declarator: mongoCollection
focal_class.modifier: private final
focal_class.original_string: private final MongoCollection<Document> mongoCollection;
focal_class.type: MongoCollection<Document>
focal_class.var_name: mongoCollection
focal_class.file: http-service/src/main/java/net/runelite/http/service/config/ConfigService.java
focal_class.identifier: ConfigService
focal_class.class_method_signature: ConfigService.ConfigService(
  		MongoClient mongoClient,
  		@Value("${mongo.database}") String databaseName
  	)
focal_class.full_signature: @Autowired public  ConfigService(
  		MongoClient mongoClient,
  		@Value("${mongo.database}") String databaseName
  	)
focal_class.identifier: ConfigService
focal_class.modifiers: @Autowired public
focal_class.parameters: (
  		MongoClient mongoClient,
  		@Value("${mongo.database}") String databaseName
  	)
focal_class.signature:  ConfigService(
  		MongoClient mongoClient,
  		@Value("${mongo.database}") String databaseName
  	)
focal_class.class_method_signature: ConfigService.getConfig(int userId)
focal_class.full_signature: private Document getConfig(int userId)
focal_class.identifier: getConfig
focal_class.modifiers: private
focal_class.parameters: (int userId)
focal_class.return: Document
focal_class.signature: Document getConfig(int userId)
focal_class.class_method_signature: ConfigService.get(int userId)
focal_class.full_signature: public Configuration get(int userId)
focal_class.identifier: get
focal_class.modifiers: public
focal_class.parameters: (int userId)
focal_class.return: Configuration
focal_class.signature: Configuration get(int userId)
focal_class.class_method_signature: ConfigService.setKey(
  		int userId,
  		String key,
  		@Nullable String value
  	)
focal_class.full_signature: public boolean setKey(
  		int userId,
  		String key,
  		@Nullable String value
  	)
focal_class.identifier: setKey
focal_class.modifiers: public
focal_class.parameters: (
  		int userId,
  		String key,
  		@Nullable String value
  	)
focal_class.return: boolean
focal_class.signature: boolean setKey(
  		int userId,
  		String key,
  		@Nullable String value
  	)
focal_class.class_method_signature: ConfigService.unsetKey(
  		int userId,
  		String key
  	)
focal_class.full_signature: public boolean unsetKey(
  		int userId,
  		String key
  	)
focal_class.identifier: unsetKey
focal_class.modifiers: public
focal_class.parameters: (
  		int userId,
  		String key
  	)
focal_class.return: boolean
focal_class.signature: boolean unsetKey(
  		int userId,
  		String key
  	)
focal_class.class_method_signature: ConfigService.parseJsonString(String value)
focal_class.full_signature: @VisibleForTesting static Object parseJsonString(String value)
focal_class.identifier: parseJsonString
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: (String value)
focal_class.return: Object
focal_class.signature: Object parseJsonString(String value)
focal_class.class_method_signature: ConfigService.validateJson(String value)
focal_class.full_signature: @VisibleForTesting static boolean validateJson(String value)
focal_class.identifier: validateJson
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: (String value)
focal_class.return: boolean
focal_class.signature: boolean validateJson(String value)
focal_class.class_method_signature: ConfigService.validateObject(JsonElement jsonElement, int depth)
focal_class.full_signature: private static boolean validateObject(JsonElement jsonElement, int depth)
focal_class.identifier: validateObject
focal_class.modifiers: private static
focal_class.parameters: (JsonElement jsonElement, int depth)
focal_class.return: boolean
focal_class.signature: boolean validateObject(JsonElement jsonElement, int depth)
focal_method.body: @VisibleForTesting
  	static Object parseJsonString(String value)
  	{
  		Object jsonValue;
  		try
  		{
  			jsonValue = RuneLiteAPI.GSON.fromJson(value, Object.class);
  
  			if (jsonValue instanceof Double || jsonValue instanceof Float)
  			{
  				Number number = (Number) jsonValue;
  				if (Math.floor(number.doubleValue()) == number.doubleValue() && !Double.isInfinite(number.doubleValue()))
  				{
  					// value is an int or long. 'number' might be truncated so parse it from 'value'
  					try
  					{
  						jsonValue = Integer.parseInt(value);
  					}
  					catch (NumberFormatException ex)
  					{
  						try
  						{
  							jsonValue = Long.parseLong(value);
  						}
  						catch (NumberFormatException ex2)
  						{
  
  						}
  					}
  				}
  			}
  		}
  		catch (JsonSyntaxException ex)
  		{
  			jsonValue = value;
  		}
  		return jsonValue;
  	}
focal_method.class_method_signature: ConfigService.parseJsonString(String value)
focal_method.full_signature: @VisibleForTesting static Object parseJsonString(String value)
focal_method.identifier: parseJsonString
focal_method.invocations: fromJson floor doubleValue doubleValue isInfinite doubleValue parseInt parseLong
focal_method.modifiers: @VisibleForTesting static
focal_method.parameters: (String value)
focal_method.return: Object
focal_method.signature: Object parseJsonString(String value)