Libraries for Java 7+
(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.
- Javadocs: http://stevewedig.github.io/blog/apidocs/
- GitHub Repo: https://github.com/stevewedig/blog
- License: This project is in the public domain via Unlicense.
Features explained via blog posts
- Value Objects in Java & Python
- Type Safe Heterogenous Containers in Java
- Digraphs, Dags, and Trees in Java
Utilities not explained via blog posts
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.
Other related blog posts
Get code, run tests, create Javadocs
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
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.
Using the libraries
Maven dependency snippet
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>
Other build tools
The Maven Central artifact page has snippets for other tools like Buildr, Ivy, and SBT.
Inheriting the GWT module
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" />