@Test( expected = IllegalStateException.class ) public void shouldNotAddFieldWithSameNameMultipleTimes () { final PortRuntimeSchemaBuilder builder = new PortRuntimeSchemaBuilder( EXTENDABLE_FIELD_SET, emptyList() ); builder.addField( "field1", int.class ); builder.addField( "field1", int.class ); }
public PortRuntimeSchemaBuilder addField ( final String fieldName, final Class<?> type ) { checkArgument( fieldName != null, "field name must be provided" ); checkArgument( type != null, "field type must be provided" ); addField( new RuntimeSchemaField( fieldName, type ) ); return this; }
PortRuntimeSchemaBuilder { public PortRuntimeSchemaBuilder addField ( final String fieldName, final Class<?> type ) { checkArgument( fieldName != null, "field name must be provided" ); checkArgument( type != null, "field type must be provided" ); addField( new RuntimeSchemaField( fieldName, type ) ); return this; } }
PortRuntimeSchemaBuilder { public PortRuntimeSchemaBuilder addField ( final String fieldName, final Class<?> type ) { checkArgument( fieldName != null, "field name must be provided" ); checkArgument( type != null, "field type must be provided" ); addField( new RuntimeSchemaField( fieldName, type ) ); return this; } PortRuntimeSchemaBuilder();  PortRuntimeSchemaBuilder( final PortSchemaScope scope, final List<RuntimeSchemaField> fields ); }
PortRuntimeSchemaBuilder { public PortRuntimeSchemaBuilder addField ( final String fieldName, final Class<?> type ) { checkArgument( fieldName != null, "field name must be provided" ); checkArgument( type != null, "field type must be provided" ); addField( new RuntimeSchemaField( fieldName, type ) ); return this; } PortRuntimeSchemaBuilder();  PortRuntimeSchemaBuilder( final PortSchemaScope scope, final List<RuntimeSchemaField> fields ); PortRuntimeSchemaBuilder addField( final String fieldName, final Class<?> type ); PortRuntimeSchemaBuilder addField( final RuntimeSchemaField field ); List<RuntimeSchemaField> getFields(); PortRuntimeSchema build(); }
PortRuntimeSchemaBuilder { public PortRuntimeSchemaBuilder addField ( final String fieldName, final Class<?> type ) { checkArgument( fieldName != null, "field name must be provided" ); checkArgument( type != null, "field type must be provided" ); addField( new RuntimeSchemaField( fieldName, type ) ); return this; } PortRuntimeSchemaBuilder();  PortRuntimeSchemaBuilder( final PortSchemaScope scope, final List<RuntimeSchemaField> fields ); PortRuntimeSchemaBuilder addField( final String fieldName, final Class<?> type ); PortRuntimeSchemaBuilder addField( final RuntimeSchemaField field ); List<RuntimeSchemaField> getFields(); PortRuntimeSchema build();  }