<commit_before># Typed Preferences

![Typed Preferences Icon](https://raw.github.com/johnjohndoe/TypedPreferences/master/gfx/typedpreferences-icon.png "Typed Preferences Icon")

This library for Android provides classes which allow to store
and retrieve settings from the preferences. There is an individual
class for each native type:


* [`BooleanPreference`][boolean-pref] for a `boolean` value
* [`DoublePreference`][double-pref] for a `double` value
* [`FloatPreference`][float-pref] for a `float` value
* [`IntPreference`][int-pref] for an `int` value
* [`LongPreference`][long-pref] for a `long` value
* [`StringPreference`][string-pref] for a `String` value

Each class comes with two constructors - one of them allows to ommit
the default value.

A common interface defines the following methods:

```java
public interface TypedPreference<T extends Object> {
    public T get();
    public boolean isSet();
    public void set(T value);
    public void delete();
}
```

## How to get the thing running?

Add the library as a dependency to your `build.gradle` in case you use Gradle:

```groovy
dependencies {
    compile 'info.metadude.android:typed-preferences:1.1.0'
}
```
Or if you use Maven you should be looking for this:

```xml
<dependency><commit_msg>Revise methods example in README.md.<commit_after># Typed Preferences

![Typed Preferences Icon](https://raw.github.com/johnjohndoe/TypedPreferences/master/gfx/typedpreferences-icon.png "Typed Preferences Icon")

This library for Android provides classes which allow to store
and retrieve settings from the preferences. There is an individual
class for each native type:


* [`BooleanPreference`][boolean-pref] for a `boolean` value
* [`DoublePreference`][double-pref] for a `double` value
* [`FloatPreference`][float-pref] for a `float` value
* [`IntPreference`][int-pref] for an `int` value
* [`LongPreference`][long-pref] for a `long` value
* [`StringPreference`][string-pref] for a `String` value

Each class comes with two constructors - one of them allows to ommit
the default value.

All classes declare the same methods `get()`, `isSet()`, `set()` and `delete()`.
Here are the method signatures as definied in the `StringPreference` class.

```java
public class StringPreference {
    public String get() { ... }
    public boolean isSet() { ... }
    public void set(String value) { ... }
    public void delete() { ... }
}
```

## How to get the thing running?

Add the library as a dependency to your `build.gradle` in case you use Gradle:

```groovy
dependencies {
    compile 'info.metadude.android:typed-preferences:1.1.0'
}
```
Or if you use Maven you should be looking for this:

```xml
<dependency>
{'fraction_non_alphanumeric': 0.11815132314573239, 'fraction_numerical': 0.0022363026462914647, 'mean_word_length': 4.7106382978723405, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '152407', 'n_tokens_mistral': 805, 'n_tokens_neox': 790, 'n_words': 300}