@Test(expected = NullPointerException.class) public void testGetFieldNullName() { structure.getField(null); }
@Override public Field getField(final String fieldName) { if (fieldName == null) { throw new NullPointerException("Field name cannot be null."); } if (!hasMember(fieldName)) { throw new IllegalArgumentException("No such field: " + fieldName); } return fieldsMap.get(fieldName.toUpperCase(Locale.getDefault())); }
StructureImpl implements Structure { @Override public Field getField(final String fieldName) { if (fieldName == null) { throw new NullPointerException("Field name cannot be null."); } if (!hasMember(fieldName)) { throw new IllegalArgumentException("No such field: " + fieldName); } return fieldsMap.get(fieldName.toUpperCase(Locale.getDefault())); } }
StructureImpl implements Structure { @Override public Field getField(final String fieldName) { if (fieldName == null) { throw new NullPointerException("Field name cannot be null."); } if (!hasMember(fieldName)) { throw new IllegalArgumentException("No such field: " + fieldName); } return fieldsMap.get(fieldName.toUpperCase(Locale.getDefault())); } StructureImpl(final Map<String, Field> fields); }
StructureImpl implements Structure { @Override public Field getField(final String fieldName) { if (fieldName == null) { throw new NullPointerException("Field name cannot be null."); } if (!hasMember(fieldName)) { throw new IllegalArgumentException("No such field: " + fieldName); } return fieldsMap.get(fieldName.toUpperCase(Locale.getDefault())); } StructureImpl(final Map<String, Field> fields); @Override Field getField(final String fieldName); @Override List<Field> getFields(); @Override DataType getType(final String fieldName); @Override boolean hasMember(final String fieldName); }
StructureImpl implements Structure { @Override public Field getField(final String fieldName) { if (fieldName == null) { throw new NullPointerException("Field name cannot be null."); } if (!hasMember(fieldName)) { throw new IllegalArgumentException("No such field: " + fieldName); } return fieldsMap.get(fieldName.toUpperCase(Locale.getDefault())); } StructureImpl(final Map<String, Field> fields); @Override Field getField(final String fieldName); @Override List<Field> getFields(); @Override DataType getType(final String fieldName); @Override boolean hasMember(final String fieldName);  }