/** * Returns the alignment of a given field. An {@code IllegalArgumentException} will be thrown if no names have been defined. * * @param fieldName the name of the field whose alignment will be returned * * @return the alignment of the given field */ public FieldAlignment getAlignment(String fieldName) { int index = indexOf(fieldName); if (index == -1) { throw new IllegalArgumentException("Field '" + fieldName + "' does not exist. Available field names are: " + this.fieldNames); } return getAlignment(index); }