Package etch.bindings.java.msg

Examples of etch.bindings.java.msg.StructValue


    {
      keysAndValues[index++] = me.getKey();
      keysAndValues[index++] = me.getValue();
    }
   
    StructValue struct = new StructValue( type, vf );
    struct.put( field, keysAndValues );
    return struct;
  }
View Full Code Here


    List<Object> list = (List<Object>) value;
   
    Object[] values = new Object[list.size()];
    list.toArray( values );
   
    StructValue struct = new StructValue( type, vf );
    struct.put( field, values );
    return struct;
  }
View Full Code Here

    Set<Object> set = (Set<Object>) value;
   
    Object[] keys = new Object[set.size()];
    set.toArray( keys );
   
    StructValue struct = new StructValue( type, vf );
    struct.put( field, keys );
    return struct;
  }
View Full Code Here

    testbadvalue( 0, 5.5f );
    testbadvalue( 0, 6.6 );
    testbadvalue( 0, "" );
    testbadvalue( 0, "abc" );
    testbadvalue( 0, new Object() );
    testbadvalue( 0, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 0, new Date() );

    testbadvalue( 1, null );
    testbadvalue( 1, false );
    testbadvalue( 1, true );
    testbadvalue( 1, (byte) 1 );
    testbadvalue( 1, (short) 2222 );
    testbadvalue( 1, 33333333 );
    testbadvalue( 1, 4444444444444444L );
    testbadvalue( 1, 5.5f );
    testbadvalue( 1, 6.6 );
    testbadvalue( 1, "" );
    testbadvalue( 1, "abc" );
    testbadvalue( 1, new Object() );
    testbadvalue( 1, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 1, new Date() );
  }
View Full Code Here

    Type type = new Type( "map" );
    Class2TypeMap class2type = new Class2TypeMap();
    StrIntHashMapSerializer.init( type, class2type );
    ImportExportHelper helper = type.getImportExportHelper();
   
    StructValue sv = helper.exportValue( vf, map );
//    System.out.println( "sv = "+sv );
   
    assertEquals( sv.type(), type );
   
    StrIntHashMap map2 = (StrIntHashMap) helper.importValue( sv );
//    System.out.println( "map2 = "+map2 );
   
    assertEquals( map, map2 );
View Full Code Here

    Type type = new Type( "date" );
    Class2TypeMap class2type = new Class2TypeMap();
    DateSerializer.init( type, class2type );
    ImportExportHelper helper = type.getImportExportHelper();
   
    StructValue sv = helper.exportValue( vf, date );
//    System.out.println( "sv = "+sv );
   
    assertEquals( sv.type(), type );
   
    Date date2 = (Date) helper.importValue( sv );
//    System.out.println( "date2 = "+date2 );
   
    assertEquals( date, date2 );
View Full Code Here

    Type type = new Type( "map" );
    Class2TypeMap class2type = new Class2TypeMap();
    StrStrHashMapSerializer.init( type, class2type );
    ImportExportHelper helper = type.getImportExportHelper();
   
    StructValue sv = helper.exportValue( vf, map );
//    System.out.println( "sv = "+sv );
   
    assertEquals( sv.type(), type );
   
    StrStrHashMap map2 = (StrStrHashMap) helper.importValue( sv );
//    System.out.println( "map2 = "+map2 );
   
    assertEquals( map, map2 );
View Full Code Here

    Type type = new Type( "url" );
    Class2TypeMap class2type = new Class2TypeMap();
    URLSerializer.init( type, class2type );
    ImportExportHelper helper = type.getImportExportHelper();
   
    StructValue sv = helper.exportValue( vf, url );
//    System.out.println( "sv = "+sv );
   
    assertEquals( sv.type(), type );
   
    URL url2 = (URL) helper.importValue( sv );
//    System.out.println( "url2 = "+url2 );
   
    assertEquals( url, url2 );
View Full Code Here

    return new URL( (String) struct.get( field ) );
  }

  public StructValue exportValue( ValueFactory vf, Object value )
  {
    StructValue struct = new StructValue( type, vf );
    struct.put( field, ((URL) value).toString() );
    return struct;
  }
View Full Code Here

    {
      keysAndValues[index++] = me.getKey();
      keysAndValues[index++] = me.getValue();
    }
   
    StructValue struct = new StructValue( type, vf );
    struct.put( field, keysAndValues );
    return struct;
  }
View Full Code Here

TOP

Related Classes of etch.bindings.java.msg.StructValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.