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

com.geotab.model.entity.user.NoUser Maven / Gradle / Ivy

/*
 *
 * 2020 Copyright (C) Geotab Inc. All rights reserved.
 */

package com.geotab.model.entity.user;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.geotab.model.enumeration.UserAuthenticationType;
import com.geotab.model.serialization.SystemEntitySerializationAware;
import java.time.LocalDateTime;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * A {@link User} that is used when no user specific user is assigned to objects, eg.
 * Notifications.
 */
@Getter
@Setter
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public final class NoUser extends User implements SystemEntitySerializationAware {

  private static class InstanceHolder {

    private static final NoUser INSTANCE = new NoUser();
  }

  public static final String NO_USER_ID = "NoUserId";

  private NoUser() {
    super(NO_USER_ID, "**", null, 0, 0, 0,
        null,
        LocalDateTime.of(1986, 1, 1, 0, 0, 0, 0),
        LocalDateTime.of(2050, 1, 1, 0, 0, 0, 0),
        null, null, false,
        "", null, null, null, null,
        null, null, null, null,
        null, null, null, null, "**", null,
        null, null, false, false,
        false, null, null, null, false,
        true, false, false, true, null, null,
        "", null, "", null, null,
        null, false,
        null, UserAuthenticationType.NONE, null, null,
        null, null, null, null, false, true);
  }

  @JsonIgnore
  @Override
  public boolean isSystemEntity() {
    return true;
  }

  public static NoUser getInstance() {
    return InstanceHolder.INSTANCE;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy