package org.gnode.nix.base;

import org.bytedeco.javacpp.annotation.Platform;

@Platform(value = "linux")
public abstract class NamedEntity extends Entity implements Comparable {

    /**
     * Setter for the type of the entity.
     *
     * @param type The type to set.
     */
    abstract public void setType(String type);

    /**
     * Getter for the type of the entity.
     * <p/>
     * The property type is used in order to allow the specification
     * of additional semantic meaning for an entity and therefore can introduce
     * domain-specificity into the quite generic data model.
     *
     * @return The current type.
     */
    abstract public String getType();

    /**
     * Getter for the name of the entity.
     * <p/>
     * The name of an entity serves as a human readable identifier. It is not obliged
     * to be unique. However it is strongly recommended to use unique name inside one specific
     * {@link org.gnode.nix.Block}.
     *
     * @return string The name of the entity.
     */
    abstract public String getName();

    /**
     * Setter for the definition of the entity.
     *
     * @param definition The definition of the entity.
     */
    abstract public void setDefinition(String definition);

    /**
     * Getter for the definition of the entity.
     * <p/>
     * The definition is an optional property that allows the user to add
     * a freely assignable textual definition to the entity.
     *
     * @return The definition of the entity.
     */
    abstract public String getDefinition();

    @Override
    public int compareTo(Object obj) {
        if (this == obj) {
            return 0;
        }
        return this.getName().compareTo(((NamedEntity) obj).getName());
    }
}

@@ -132,16 +132,39 @@
 edEntity
+%3CT extends NamedEntity%3E
  extends
@@ -192,16 +192,19 @@
 mparable
+%3CT%3E
  %7B%0A%0A    
@@ -1623,14 +1623,9 @@
 eTo(
-Object
+T
  obj
@@ -1731,27 +1731,11 @@
 eTo(
-((NamedEntity) 
 obj
-)
 .get

use comparable<T> and remove cast