package sklep.model;

import java.lang.reflect.Field;

abstract class WspolnaNadklasa {
	@Override
	public String toString() {
		StringBuilder result = new StringBuilder();
		Class<? extends WspolnaNadklasa> klasa = this.getClass();
		result.append(klasa.getSimpleName()).append(" [");
		
		for(Field field : klasa.getDeclaredFields()) {
			try {
				// FIXME
				//Object value = field.get(this);
				result.append(field.getName()).append('=').append(", ");
			} catch (IllegalArgumentException e) {
				System.err.println(e);
			}
		}
		result.append("]");
		
		return result.toString();
	}

}
