Skip to content

Commit

Permalink
add getType to LazyElement
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperjj committed Feb 15, 2017
1 parent 5cf2efc commit c3584b6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = '1.2.6'
version = '1.2.7'

group = "me.doubledutch"
archivesBaseName = "lazyjson"
Expand Down Expand Up @@ -83,7 +83,7 @@ jar {
attributes 'Implementation-Title': 'LazyJSON Library', 'Implementation-Version': version
}
}
/*

uploadArchives {
repositories {
mavenDeployer {
Expand Down Expand Up @@ -129,4 +129,3 @@ uploadArchives {
}
}
}
*/
9 changes: 9 additions & 0 deletions src/main/java/me/doubledutch/lazyjson/LazyArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ protected LazyArray(LazyNode root,char[] source){
super(root,source);
}

/**
* Returns the type of this element.
*
* @return LazyType.ARRAY
*/
public LazyType getType(){
return LazyType.ARRAY;
}

/**
* Returns the value type of the given field.
*
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/me/doubledutch/lazyjson/LazyElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.nio.ByteBuffer;
import java.nio.BufferOverflowException;

public class LazyElement{
public abstract class LazyElement{
protected LazyNode root;
protected char[] cbuf;

Expand All @@ -31,6 +31,8 @@ public Template extractTemplate(){
return t;
}

public abstract LazyType getType();

public void writeTemplateValues(ByteBuffer buf,DictionaryCache dict) throws BufferOverflowException{
root.writeSegmentValues(cbuf,buf,dict);
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/me/doubledutch/lazyjson/LazyObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ protected LazyObject(LazyNode root,char[] source){
super(root,source);
}


/**
* Returns the type of this element.
*
* @return LazyType.OBJECT
*/
public LazyType getType(){
return LazyType.OBJECT;
}

/**
* Returns the value type of the given field.
*
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/lazyjson_version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Wed Jan 25 14:12:37 PST 2017
BUILD_VERSION=1.2.6
BUILD_DATE=2017-01-25T22\:12\:37Z
BUILD_NUMBER=669
#Wed Feb 15 11:28:09 PST 2017
BUILD_VERSION=1.2.7
BUILD_DATE=2017-02-15T19\:28\:09Z
BUILD_NUMBER=673

0 comments on commit c3584b6

Please sign in to comment.