com.geotab.model.entity.device.NoDevice Maven / Gradle / Ivy
/*
*
* 2020 Copyright (C) Geotab Inc. All rights reserved.
*/
package com.geotab.model.entity.device;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.geotab.model.entity.group.CompanyGroup;
import com.geotab.model.serialization.SystemEntitySerializationAware;
import com.google.common.collect.Lists;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* A {@link Device} type that represents no device.
*/
@Getter
@Setter
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public final class NoDevice extends Device implements SystemEntitySerializationAware {
private static class InstanceHolder {
private static final NoDevice INSTANCE = new NoDevice();
}
public static final String NO_DEVICE_ID = "NoDeviceId";
private NoDevice() {
super(NO_DEVICE_ID, "**NoDevice", null, null, null, null, null,
null, null, Lists.newArrayList(new CompanyGroup()), null, null,
null, null, null, null, null, null);
}
public static NoDevice getInstance() {
return InstanceHolder.INSTANCE;
}
@JsonIgnore
@Override
public boolean isSystemEntity() {
return true;
}
}