Skip to content

Commit

Permalink
fix lightblue-platform#120: Add literal class instead of literalRvalue
Browse files Browse the repository at this point in the history
  • Loading branch information
Burak Serdar committed May 27, 2015
1 parent 3e830db commit 9c5dd5f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.redhat.lightblue.client.expression.update;

public class Literal implements RValue {
private final Object value;

public Literal(String value) {
this.value = value;
}

public Literal(int value) {
this.value = new Integer(value);
}

public Literal(double value) {
this.value = new Double(value);
}

public Literal(float value) {
this.value = new Float(value);
}

public Literal(long value) {
this.value = new Long(value);
}

public Literal(Object value) {
this.value = value;
}

@Override
public String toJson() {
if(value==null)
return null;
else if(value instanceof String)
return "\""+value+"\"";
else
return value.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/**
* created by Michael White 10/10/2014
*/
@Deprecated
public class LiteralRValue implements RValue {
private final String value;

Expand Down

0 comments on commit 9c5dd5f

Please sign in to comment.