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

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

package com.geotab.model.entity.user;

import com.geotab.model.Id;
import com.geotab.model.serialization.SystemEntitySerializationAware;
import lombok.Getter;
import lombok.Setter;

/**
 * A {@link User} that is used when no user specific user is assigned to objects, eg. Notifications.
 */
@Getter @Setter
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() {
    setId(new Id(NO_USER_ID));
    setName("**");
    setVersion(0L);
  }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy