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

net.officefloor.woof.model.teams.PropertyModel Maven / Gradle / Ivy

There is a newer version: 3.40.0
Show newest version
/*
 * 
 */
package net.officefloor.woof.model.teams;

import javax.annotation.Generated;

import net.officefloor.model.AbstractModel;
import net.officefloor.model.ConnectionModel;
import net.officefloor.model.ItemModel;
import net.officefloor.model.RemoveConnectionsAction;

@Generated("net.officefloor.model.generate.ModelGenerator")
public class PropertyModel extends AbstractModel implements ItemModel, PropertySourceModel {

    public static enum PropertyEvent {
     CHANGE_NAME, CHANGE_VALUE
    }

    /**
     * Default constructor.
     */
    public PropertyModel() {
    }

    /**
     * Convenience constructor.
     *
     * @param name Name.
     * @param value Value.
     */
    public PropertyModel(
      String name
    , String value
    ) {
        this.name = name;
        this.value = value;
    }

    /**
     * Convenience constructor allowing XY initialising.
     *
     * @param name Name.
     * @param value Value.
     * @param x Horizontal location.
     * @param y Vertical location.
     */
    public PropertyModel(
      String name
    , String value
    , int x
    , int y
    ) {
        this.name = name;
        this.value = value;
        this.setX(x);
        this.setY(y);
    }


    /**
     * Name.
     */
    private String name;

    /**
     * @return Name.
     */
    public String getName() {
        return this.name;
    }

    /**
     * @param name Name.
     */
    public void setName(String name) {
        String oldValue = this.name;
        this.name = name;
        this.changeField(oldValue, this.name, PropertyEvent.CHANGE_NAME);
    }


    /**
     * Value.
     */
    private String value;

    /**
     * @return Value.
     */
    public String getValue() {
        return this.value;
    }

    /**
     * @param value Value.
     */
    public void setValue(String value) {
        String oldValue = this.value;
        this.value = value;
        this.changeField(oldValue, this.value, PropertyEvent.CHANGE_VALUE);
    }


    /**
     * Remove Connections.
     *
     * @return {@link RemoveConnectionsAction} to remove the {@link ConnectionModel} instances.
     */
    public RemoveConnectionsAction removeConnections() {
        RemoveConnectionsAction _action = new RemoveConnectionsAction(this);
        return _action;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy