Exemplo n.º 1
0
 private static boolean equal(List<Value> values1, List<Value> values2) {
   if (values1.size() != values2.size()) return false;
   for (int i = 0; i < values1.size(); i++) {
     Value v1 = values1.get(i);
     Value v2 = values2.get(i);
     if (!v1.equals(v2)) return false;
   }
   return true;
 }
Exemplo n.º 2
0
 public static String toString(Value rv, boolean withType) {
   if (withType) return toString(rv);
   switch (rv.getType()) {
     case BINARY:
       return arrayToHexString(rv.getBinaryValue());
     case DOUBLE:
       return Double.toString(rv.getDoubleValue());
     case FLOAT:
       return Float.toString(rv.getFloatValue());
     case SINT32:
       return Integer.toString(rv.getSint32Value());
     case UINT32:
       return Long.toString(rv.getUint32Value() & 0xFFFFFFFFL);
     case SINT64:
       return Long.toString(rv.getSint64Value());
     case UINT64:
       if (rv.getUint64Value() >= 0) return Long.toString(rv.getUint64Value());
       else return BigInteger.valueOf(rv.getUint64Value()).add(B64).toString();
     case STRING:
       return rv.getStringValue();
     case BOOLEAN:
       return Boolean.toString(rv.getBooleanValue());
     case TIMESTAMP:
       return TimeEncoding.toOrdinalDateTime(rv.getTimestampValue());
   }
   return null;
 }
Exemplo n.º 3
0
 public static String toString(Value rv) {
   switch (rv.getType()) {
     case BINARY:
       return "(BINARY)" + arrayToHexString(rv.getBinaryValue());
     case DOUBLE:
       return "(DOUBLE)" + rv.getDoubleValue();
     case FLOAT:
       return "(FLOAT)" + rv.getFloatValue();
     case SINT32:
       return "(SIGNED_INTEGER)" + rv.getSint32Value();
     case UINT32:
       return "(UNSIGNED_INTEGER)" + Long.toString(rv.getUint32Value() & 0xFFFFFFFFL);
     case SINT64:
       return "(SIGNED_INTEGER)" + rv.getSint64Value();
     case UINT64:
       return "(UNSIGNED_INTEGER)" + rv.getUint64Value();
     case STRING:
       return "(STRING)" + rv.getStringValue();
     case BOOLEAN:
       return "(BOOLEAN)" + rv.getBooleanValue();
     case TIMESTAMP:
       return "(TIMESTAMP)" + TimeEncoding.toOrdinalDateTime(rv.getTimestampValue());
   }
   return null;
 }