(GitHub has a rendered version of this readme: https://github.com/stevewedig/blog/)
We all build up util code over time. In this project I'm sharing the most reusable parts of my codebase. As I publish features I'll be describing them on my blog and sharing the code via GitHub & Maven. I build on Google Guava, so you can think of these libraries as an extension of Guava, which itself is an extension of Java's standard library.
This project is compatable with Java 7+ and all code can be compiled to JavaScript by Google Web Toolkit 2.6+. The only runtime dependency is Guava.
- Javadocs: http://stevewedig.github.io/blog/apidocs/
- GitHub Repo: https://github.com/stevewedig/blog
- License: This project is in the public domain via Unlicense.
- Value Objects in Java & Python
- Type Safe Heterogenous Containers in Java
- Digraphs, Dags, and Trees in Java
These utilities should be fairly self explanatory...
- StrLib demonstrated in TestStrLib: String manipulation utilities. (Behavior not found in Guava's Strings or Apache Commons StringUtils.)
- LambdaLib demonstrated in TestLambdaLib: Interfaces for creating anonymous lambdas (callbacks). Presumably I can get rid of this horrible syntax when I switch to Java 8.
- CollectLib demonstrated in TestCollectLib
- SetLib demonstrated in TestSetLib
- MultimapLib demonstrated in TestMultimapLib
- blog.errors: A collection of common errors, and an ErrorMixin which adds string formatting constructors to RuntimeException.
Use Git to get the project code:
cd <PROJECT_ROOT_PARENT>
git clone https://github.com/stevewedig/blog.git
Use Maven to run the tests:
cd <PROJECT_ROOT>
mvn test
Use Maven to generate the site, including the Javadocs:
cd <PROJECT_ROOT>
mvn site
# open site index: target/site/index.html
# or
# open javadoc index: target/site/project-reports.html
Javadocs for the latest release are also available at http://stevewedig.github.io/blog/apidocs/
The root directory is a Maven project with the standard layout. The root directory is also a project for the Eclipse IDE. If you are using Eclipse, you can import the project under "Import > General > Existing Projects into Workspace". If you are not using Eclipse, you can disregard or delete the Eclipse project metadata files: .classpath, .project, .settings.
- Library code: src/main/java/com/stevewedig/blog/
- Test code: src/test/java/com/stevewedig/blog/
- Directory built by Maven: target/
- Project's site root: target/site/index.html (Javadocs are linked to under "Project Reports")
- Project's Javadoc root: target/site/apidocs/index.html
More about the standard layout of Maven projects.
The easiest way to use this library is add it your dependency list in your Maven pom.xml file:
<dependencies>
<dependency>
<groupId>com.stevewedig</groupId>
<artifactId>blog</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
The Maven Central artifact page has snippets for other tools like Buildr, Ivy, and SBT.
If you're using GWT, in addition to getting the code via Maven or other mechanism, add this line to your .gwt.xml file:
<inherits name="com.stevewedig.blog.Blog" />