Commit 14b8c6ba authored by Roan OSullivan's avatar Roan OSullivan

Resolved Jackson JSON Deserialization when retrieving Projects. This fixes...

Resolved Jackson JSON Deserialization when retrieving Projects. This fixes [Issue #45](https://github.com/timols/java-gitlab-api/issues/45).
parent 4b1f226d
......@@ -68,12 +68,12 @@
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.9</version>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.9</version>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
......@@ -129,6 +129,20 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
package org.gitlab.api.models;
import org.codehaus.jackson.annotate.JsonCreator;
public enum GitlabAccessLevel {
Guest(10),
......@@ -14,6 +15,8 @@ public enum GitlabAccessLevel {
this.accessValue = accessValue;
}
// http://fasterxml.github.io/jackson-annotations/javadoc/2.2.0/index.html?com/fasterxml/jackson/annotation/JsonCreator.html
@JsonCreator
public static GitlabAccessLevel fromAccessValue(final int accessValue) throws IllegalArgumentException {
for (final GitlabAccessLevel gitlabAccessLevel : GitlabAccessLevel.values()) {
if (gitlabAccessLevel.accessValue == accessValue) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment