Ejemplo n.º 1
0
  public static void main(String[] args) {

    PropertyBag bag = new PropertyBag();
    bag.putByte(0, (byte) 1);
    bag.putShort(1, (short) 2);
    bag.putInt(2, (int) 3);
    bag.putLong(3, (long) 4);
    bag.putFloat(4, (float) 1.1);
    bag.putDouble(5, (double) 2.2);
    bag.putBytes(6, new byte[] {0, 1, 2, 3});
    bag.putString(7, "1234");
    bag.putBoolean(8, true);
    bag.putNull(9);

    PropertyBag bag2 = new PropertyBag();
    bag2.put(0, (byte) 1);
    bag2.put(1, (short) 2);
    bag2.put(2, (int) 3);
    bag2.put(3, (long) 4);
    bag2.put(4, (float) 1.1);
    bag2.put(5, (double) 2.2);
    bag2.put(6, new byte[] {0, 1, 2, 3});
    bag2.put(7, "1234");
    bag2.put(8, bag);
    bag2.putBoolean(9, true);
    bag2.putNull(10);

    bag2.put(11, bag);

    PropertyBag test = PropertyBag.valueOfByties(bag2.getByties());

    System.out.println(test.toString());
  }