@Test public void testSetChosenField() { DerivedClass derivedClass = new DerivedClass(); derivedClass.setChosenFieldName("childField"); assertEquals("childField", derivedClass.getChosenFieldName()); derivedClass.setChosenField("childField", "childFieldValue"); assertEquals("childFieldValue", derivedClass.getChildField()); }
public void setChosenField(String fieldName, Object fieldValue) { this.chosenFieldName = fieldName; Field field; try { field = this.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(this, fieldValue); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { logger.error("Error Setting Chosen Field", e); } }
J2735Choice extends Asn1Object { public void setChosenField(String fieldName, Object fieldValue) { this.chosenFieldName = fieldName; Field field; try { field = this.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(this, fieldValue); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { logger.error("Error Setting Chosen Field", e); } } }
J2735Choice extends Asn1Object { public void setChosenField(String fieldName, Object fieldValue) { this.chosenFieldName = fieldName; Field field; try { field = this.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(this, fieldValue); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { logger.error("Error Setting Chosen Field", e); } } J2735Choice(); }
J2735Choice extends Asn1Object { public void setChosenField(String fieldName, Object fieldValue) { this.chosenFieldName = fieldName; Field field; try { field = this.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(this, fieldValue); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { logger.error("Error Setting Chosen Field", e); } } J2735Choice(); String getChosenFieldName(); void setChosenFieldName(String fieldName); void setChosenField(String fieldName, Object fieldValue); }
J2735Choice extends Asn1Object { public void setChosenField(String fieldName, Object fieldValue) { this.chosenFieldName = fieldName; Field field; try { field = this.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(this, fieldValue); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { logger.error("Error Setting Chosen Field", e); } } J2735Choice(); String getChosenFieldName(); void setChosenFieldName(String fieldName); void setChosenField(String fieldName, Object fieldValue);  }