<commit_before>/*
 *  Copyright (C) 2010-2012 <NAME> (Akvo Foundation)
 *
 *  This file is part of Akvo FLOW.
 *
 *  Akvo FLOW is free software: you can redistribute it and modify it under the terms of
 *  the GNU Affero General Public License (AGPL) as published by the Free Software Foundation,
 *  either version 3 of the License or any later version.
 *
 *  Akvo FLOW is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU Affero General Public License included below for more details.
 *
 *  The full license text can also be seen at <http://www.gnu.org/licenses/agpl.html>.
 */

package org.waterforpeople.mapping.app.gwt.client.device;

import java.util.Date;

import com.gallatinsystems.device.domain.Device;
import com.gallatinsystems.framework.gwt.dto.client.BaseDto;

public class DeviceDto extends BaseDto {

    private static final long serialVersionUID = 3197857074399585732L;
    private String phoneNumber;
    private String esn;
    private Double lastKnownLat;
    private Double lastKnownLon;
    private Double lastKnownAccuracy;
    private Date lastPositionDate;
    private String gallatinSoftwareManifest;
    private String deviceGroup;
    private String deviceGroupName;
    private String deviceIdentifier;
    private Device device;

    public DeviceDto() {

    }

    public DeviceDto(Device device) {
        this.device = device;
    }

    public String getGallatinSoftwareManifest() {
        if (this.device != null) {
            return device.getGallatinSoftwareManifest();
        }
        return gallatinSoftwareManifest;
    }

    public void setGallatinSoftwareManifest(String gallatinSoftwareManifest) {
        this.gallatinSoftwareManifest = gallatinSoftwareManifest;
    }

    public String getDeviceIdentifier() {
        if (this.device != null) {
            return device.getDeviceIdentifier();
        }
        return deviceIdentifier;
    }

    public void setDeviceIdentifier(String deviceIdentifier) {
        this.deviceIdentifier = deviceIdentifier;
    }

    public String getDeviceGroup() {
        if (this.device != null) {
            return device.getDeviceGroup();
        }
        return deviceGroup;
    }

    public void setDeviceGroup(String deviceGroup) {
        this.deviceGroup = deviceGroup;
    }

    public Double getLastKnownLat() {
        if (this.device != null) {
            return device.getLastKnownLat();
        }
        return lastKnownLat;
    }

    public void setLastKnownLat(Double lastKnownLat) {
        this.lastKnownLat = lastKnownLat;
    }

    public Double getLastKnownLon() {
        if (this.device != null) {
            return device.getLastKnownLon();
        }
        return lastKnownLon;
    }

    public void setLastKnownLon(Double lastKnownLon) {
        this.lastKnownLon = lastKnownLon;
    }

    public Double getLastKnownAccuracy() {
        if (this.device != null) {
            return device.getLastKnownAccuracy();
        }
        return lastKnownAccuracy;
    }

    public void setLastKnownAccuracy(Double lastKnownAccuracy) {
        this.lastKnownAccuracy = lastKnownAccuracy;
    }

    public Date getLastPositionDate() {
        if (this.device != null) {
            return device.getLastLocationBeaconTime();
        }
        return lastPositionDate;
    }

    public void setLastPositionDate(Date lastPositionDate) {
        this.lastPositionDate = lastPositionDate;
    }

    public String getEsn() {
        if (this.device != null) {
            return device.getEsn();
        }
        return esn;
    }

    public void setEsn(String esn) {
        this.esn = esn;
    }

    public String getPhoneNumber() {
        if (this.device != null) {
            return device.getPhoneNumber();
        }
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public void setDeviceGroupName(String deviceGroupName) {
        this.deviceGroupName = deviceGroupName;
    }

    public String getDeviceGroupName() {
        return deviceGroupName;
    }
}<commit_msg>[#1803] Include `keyId` element in returned response<commit_after>/*
 *  Copyright (C) 2010-2012 <NAME> (Akvo Foundation)
 *
 *  This file is part of Akvo FLOW.
 *
 *  Akvo FLOW is free software: you can redistribute it and modify it under the terms of
 *  the GNU Affero General Public License (AGPL) as published by the Free Software Foundation,
 *  either version 3 of the License or any later version.
 *
 *  Akvo FLOW is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU Affero General Public License included below for more details.
 *
 *  The full license text can also be seen at <http://www.gnu.org/licenses/agpl.html>.
 */

package org.waterforpeople.mapping.app.gwt.client.device;

import java.util.Date;

import com.gallatinsystems.device.domain.Device;
import com.gallatinsystems.framework.gwt.dto.client.BaseDto;

public class DeviceDto extends BaseDto {

    private static final long serialVersionUID = 3197857074399585732L;
    private String phoneNumber;
    private String esn;
    private Double lastKnownLat;
    private Double lastKnownLon;
    private Double lastKnownAccuracy;
    private Date lastPositionDate;
    private String gallatinSoftwareManifest;
    private String deviceGroup;
    private String deviceGroupName;
    private String deviceIdentifier;
    private Device device;

    public DeviceDto() {

    }

    public DeviceDto(Device device) {
        this.device = device;
    }

    public String getGallatinSoftwareManifest() {
        if (this.device != null) {
            return device.getGallatinSoftwareManifest();
        }
        return gallatinSoftwareManifest;
    }

    public void setGallatinSoftwareManifest(String gallatinSoftwareManifest) {
        this.gallatinSoftwareManifest = gallatinSoftwareManifest;
    }

    public String getDeviceIdentifier() {
        if (this.device != null) {
            return device.getDeviceIdentifier();
        }
        return deviceIdentifier;
    }

    public void setDeviceIdentifier(String deviceIdentifier) {
        this.deviceIdentifier = deviceIdentifier;
    }

    public String getDeviceGroup() {
        if (this.device != null) {
            return device.getDeviceGroup();
        }
        return deviceGroup;
    }

    public void setDeviceGroup(String deviceGroup) {
        this.deviceGroup = deviceGroup;
    }

    public Double getLastKnownLat() {
        if (this.device != null) {
            return device.getLastKnownLat();
        }
        return lastKnownLat;
    }

    public void setLastKnownLat(Double lastKnownLat) {
        this.lastKnownLat = lastKnownLat;
    }

    public Double getLastKnownLon() {
        if (this.device != null) {
            return device.getLastKnownLon();
        }
        return lastKnownLon;
    }

    public void setLastKnownLon(Double lastKnownLon) {
        this.lastKnownLon = lastKnownLon;
    }

    public Double getLastKnownAccuracy() {
        if (this.device != null) {
            return device.getLastKnownAccuracy();
        }
        return lastKnownAccuracy;
    }

    public void setLastKnownAccuracy(Double lastKnownAccuracy) {
        this.lastKnownAccuracy = lastKnownAccuracy;
    }

    public Date getLastPositionDate() {
        if (this.device != null) {
            return device.getLastLocationBeaconTime();
        }
        return lastPositionDate;
    }

    public void setLastPositionDate(Date lastPositionDate) {
        this.lastPositionDate = lastPositionDate;
    }

    public String getEsn() {
        if (this.device != null) {
            return device.getEsn();
        }
        return esn;
    }

    public void setEsn(String esn) {
        this.esn = esn;
    }

    public String getPhoneNumber() {
        if (this.device != null) {
            return device.getPhoneNumber();
        }
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public void setDeviceGroupName(String deviceGroupName) {
        this.deviceGroupName = deviceGroupName;
    }

    public String getDeviceGroupName() {
        return deviceGroupName;
    }

    @Override
    public Long getKeyId() {
        if (this.device != null) {
            return device.getKey().getId();
        }
        return super.getKeyId();
    }
}
{'fraction_non_alphanumeric': 0.07597275141438634, 'fraction_numerical': 0.006927606511950121, 'mean_word_length': 2.5734323432343236, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3873874', 'n_tokens_mistral': 2475, 'n_tokens_neox': 2311, 'n_words': 655}