Skip to content

Commit

Permalink
1.1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
jeantapias committed Apr 20, 2022
1 parent c879e15 commit 2c38020
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.myzlab</groupId>
<artifactId>K</artifactId>
<version>1.1.15.1</version>
<version>1.1.18</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ve/zlab/k/KCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
Expand Down Expand Up @@ -884,6 +885,10 @@ public KCollection addProperty(final String property, final Object value) throws
return this;
}

public Iterator<KRow> iterator() {
return collection.iterator();
}

public <T, V> Map<T, V> twoColumnsToMap(final String key, final String value, final Class<T> clazzT, final Class<V> clazzV) throws KException {
final Map<T, V> map = new HashMap<>();

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/ve/zlab/k/KRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ public UUID getUUID(final int n) {
return null;
}

if (o[n] == null) {
return null;
}

if (o[n] instanceof String) {
return UUID.fromString((String) o[n]);
}

return (UUID) o[n];
}

Expand Down
6 changes: 5 additions & 1 deletion src/main/java/ve/zlab/k/response/DynamicObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ public DynamicObject addProperties(final Map<String, ?> map) {
}

public Response toResponse() {
return Response.ok(this.toJSON()).build();
return toResponse(Response.Status.OK);
}

public Response toResponse(Response.Status status) {
return Response.status(status).entity(this.toJSON()).build();
}

public String toJSON() {
Expand Down

0 comments on commit 2c38020

Please sign in to comment.