Primitive Types

The most common case for configuration values are primitives.

# A string key1 = foo # A boolean key2 = true # An integer key3 = 123 # A long key4 = 10000000000 # Doubles key5 = 6.67e−11 key6 = Infinity

The following methods are provided for accessing primitive values:

- {@link oaj.config.Config}
  - {@link oaj.config.Config#getString(String) getString(String)}
  - {@link oaj.config.Config#getString(String,String) getString(String,String)}
  - {@link oaj.config.Config#getBoolean(String) getBoolean(String)}
  - {@link oaj.config.Config#getBoolean(String,boolean) getBoolean(String,boolean)}
  - {@link oaj.config.Config#getInt(String) getInt(String)}
  - {@link oaj.config.Config#getInt(String,int) getInt(String,int)}
  - {@link oaj.config.Config#getLong(String) getLong(String)}
  - {@link oaj.config.Config#getLong(String,long) getLong(String,long)}
  - {@link oaj.config.Config#getFloat(String) getFloat(String)}
  - {@link oaj.config.Config#getFloat(String,float) getFloat(String,long)}
  - {@link oaj.config.Config#getDouble(String) getDouble(String)}
  - {@link oaj.config.Config#getDouble(String,double) getDouble(String,long)}

On integers and longs, "K", "M", and "G" can be used to identify kilo, mega, and giga.

key1 = 100K # Same as 1024000 key2 = 100M # Same as 104857600

Numbers can also use hexadecimal and octal notation:

hex1 = 0x12FE hex2 = 0X12FE octal1 = 01234

Strings with newlines are treated as multi-line values that get broken into separate lines:

key1 = This is a particularly long sentence that we want to split onto separate lines.

Typically, multi-line values are started on the next line for clarity like so:

key1 = This is a particularly long sentence that we want to split onto separate lines.