001/*
002 * Copyright (C) Photon Vision.
003 *
004 * This program is free software: you can redistribute it and/or modify
005 * it under the terms of the GNU General Public License as published by
006 * the Free Software Foundation, either version 3 of the License, or
007 * (at your option) any later version.
008 *
009 * This program is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012 * GNU General Public License for more details.
013 *
014 * You should have received a copy of the GNU General Public License
015 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
016 */
017
018package org.photonvision.common.dataflow.events;
019
020import org.photonvision.common.dataflow.DataChangeDestination;
021import org.photonvision.common.dataflow.DataChangeSource;
022
023public class DataChangeEvent<T> {
024    public final DataChangeSource sourceType;
025    public final DataChangeDestination destType;
026    public final String propertyName;
027    public final T data;
028
029    public DataChangeEvent(
030            DataChangeSource sourceType,
031            DataChangeDestination destType,
032            String propertyName,
033            T newValue) {
034        this.sourceType = sourceType;
035        this.destType = destType;
036        this.propertyName = propertyName;
037        this.data = newValue;
038    }
039
040    @Override
041    public String toString() {
042        return "DataChangeEvent{"
043                + "sourceType="
044                + sourceType
045                + ", destType="
046                + destType
047                + ", propertyName='"
048                + propertyName
049                + '\''
050                + ", data="
051                + data
052                + '}';
053    }
054}