<commit_before># TypeTools 0.3.0

A simple, zero-dependency set of tools for working with Java types.

## Introduction

One of the sore points with Java involves working with type information. In particular, Java's generics implementation doesn't provide a way to resolve the type information for a given class. TypeTools looks to solve this by fully resolving generic type information declared on any class, interface or method.

## Setup

Add TypeTools as a Maven dependency:

```xml
<dependency>
  <groupId>org.jodah</groupId>
  <artifactId>typetools</artifactId>
  <version>0.3.0</version>
</dependency>
```

## Usage

Generic type resolution offered by the `TypeResolver` class:

* `resolveRawArguments(Class<T> type, Class<S> subType)`: Resolves the raw classes representing type arguments for a `type` using type variable information from a `subType`.
* `resolveRawArgument(Class<T> type, Class<S> subType)`: Resolves the raw class representing the type argument for a `type` using type variable information from a `subType`.
* `resolveGenericType(Class<?> type, Type subType)`: Resolves the generic `type` using type variable information from a `subType`.
* `resolveRawClass(Type genericType, Class<?> subType)`: Resolves the raw class for a `genericType` using type variable information from a `subType`. 

## Examples

A typical use case is to resolve the type arguments for a type given a sub-type:

```java
class Foo extends Bar<ArrayList<String>> {}
class Bar<T> implements Baz<HashSet<Integer>, T> {}
interface Baz<T1, T2> {}

Class<?>[] typeArguments = TypeResolver.resolveRawArguments(Baz.class, Foo.class);
<commit_msg>Simplified the readme a bit<commit_after># TypeTools 0.3.0

A simple, zero-dependency set of tools for working with Java types.

## Introduction

One of the sore points with Java involves working with type information. In particular, Java's generics implementation doesn't provide a way to resolve the type information for a given class. TypeTools looks to solve this by fully resolving generic type information declared on any class, interface or method.

## Setup

Add TypeTools as a Maven dependency:

```xml
<dependency>
  <groupId>org.jodah</groupId>
  <artifactId>typetools</artifactId>
  <version>0.3.0</version>
</dependency>
```

## Usage

Generic type resolution offered by the `TypeResolver` class:

* `resolveRawArguments(Class<T> type, Class<S> subType)`: Resolves the raw classes representing type arguments for a `type` using type variable information from a `subType`.
* `resolveRawArgument(Class<T> type, Class<S> subType)`: Resolves the raw class representing the type argument for a `type` using type variable information from a `subType`.
* `resolveGenericType(Class<?> type, Type subType)`: Resolves the generic `type` using type variable information from a `subType`.
* `resolveRawClass(Type genericType, Class<?> subType)`: Resolves the raw class for a `genericType` using type variable information from a `subType`. 

## Examples

A typical use case is to resolve the type arguments for a type given a sub-type:

```java
interface Foo<T1, T2> {}
class Bar<T> implements Foo<HashSet<Integer>, T> {}
class Baz extends Bar<ArrayList<String>> {}

Class<?>[] typeArguments = TypeResolver.resolveRawArguments(Foo.class, Baz.class);

{'fraction_non_alphanumeric': 0.09555690809494827, 'fraction_numerical': 0.004869141813755326, 'mean_word_length': 5.5089108910891085, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, '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': '1606646', 'n_tokens_mistral': 928, 'n_tokens_neox': 884, 'n_words': 394}