Package etch.bindings.java.msg

Examples of etch.bindings.java.msg.StructValue


    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

    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

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

    // string
    Assert.assertEquals( TypeCode.EMPTY_STRING, btdo.checkValue( "" ) );
    Assert.assertEquals( TypeCode.STRING, btdo.checkValue( "abc" ) );
   
    // struct
    Assert.assertEquals( TypeCode.CUSTOM, btdo.checkValue( new StructValue( new Type( "foo" ), vf ) ) );
   
    // custom
    Assert.assertEquals( TypeCode.CUSTOM, btdo.checkValue( new Date() ) );
   
    // none
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

    testgoodvalue( 0, 5.5f );
    testgoodvalue( 0, 6.6 );
    testgoodvalue( 0, "" );
    testgoodvalue( 0, "abc" );
    testgoodvalue( 0, new Object() );
    testgoodvalue( 0, new StructValue( new Type( "abc" ), vf ) );
    testgoodvalue( 0, new Date() );
  }
View Full Code Here

    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

    return new Date( (Long) struct.get( field ) );
  }

  public StructValue exportValue( ValueFactory vf, Object value )
  {
    StructValue struct = new StructValue( type, vf );
    struct.put( field, ((Date) value).getTime() );
    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.