All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.landel.utils.model.AbstractModelOverObject Maven / Gradle / Ivy

/*
 * #%L
 * utils-model
 * %%
 * Copyright (C) 2016 Gilandel
 * %%
 * Authors: Gilles Landel
 * URL: https://github.com/Gilandel
 * 
 * This file is under Apache License, version 2.0 (2004).
 * #L%
 */
package fr.landel.utils.model;

import java.util.HashMap;
import java.util.Map;

import fr.landel.utils.commons.over.AbstractOverObject;

/**
 * Abstract class to force implementation of Object methods (replace
 * StringBuilder from overToString by a map).
 *
 * @since 14 juil. 2015
 * @author Gilles
 * 
 * @param 
 *            The over object type.
 */
public abstract class AbstractModelOverObject> extends AbstractOverObject {
    /**
     * 
     * Constructor
     *
     */
    public AbstractModelOverObject() {
        super();
    }

    /**
     * Constructor.
     *
     * @param clazz
     *            The over class.
     */
    public AbstractModelOverObject(final Class clazz) {
        super(clazz);
    }

    /**
     * To force implementation of toString.
     * 
     * @param map
     *            The map of properties.
     */
    protected abstract void overToString(final Map map);

    @Override
    protected void overToString(final StringBuilder sb) {
        final Map map = new HashMap<>();
        this.overToString(map);
        AbstractOverObject.mapToString(sb, map);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy