EN · DE · RU · FR · ES

#367: AddressbookFilter.java

projectforge-business/src/main/java/org/projectforge/business/address/AddressbookFilter.java Typ: Java · Rolle: Komponente · Quelle: projectforge-business/src/main/java/org/projectforge/business/address/AddressbookFilter.java 149 Zeilen · 72 Code · 58 Kommentare · 19 leer
Bean für Filter-/Suchkriterien für Addressbook-Abfragen. Erweitert BaseSearchFilter, um typisierte Abfrageparameter für Listenansichten und Excel-Exporte bereitzustellen.

Codestruktur

Paket: org.projectforge.business.address

Klassen: AddressbookFilter

Enums: OwnerType

Erweitert: BaseSearchFilter

Implementiert: Serializable

Methoden (10): getOwnerType, setOwnerType, isAdmin, isAll, isOwn, isOthers, isReadonlyAccess, setReadonlyAccess, isFullAccess, setFullAccess

Felder (2): serialVersionUID, abOwner

Importe: 2 Pakete

Quellcode (gekürzt)

package org.projectforge.business.address;

import org.projectforge.framework.persistence.api.BaseSearchFilter;

import java.io.Serializable;

/**
 * @author M. Lauterbach (m.lauterbach@micromata.de)
 */
public class AddressbookFilter extends BaseSearchFilter implements Serializable
{
  private static final long serialVersionUID = 7410573665085873058L;

  public enum OwnerType
  {
    ALL, OWN, OTHERS, ADMIN
  }

  private boolean fullAccess, readonlyAccess;

  protected OwnerType abOwner;

  public AddressbookFilter()
  {
    this(null);
  }

  public AddressbookFilter(final BaseSearchFilter filter)
  {
    super(filter);
    fullAccess = readonlyAccess = true;
    abOwner = OwnerType.ALL;
    if (filter instanceof AddressbookFilter) {
      final AddressbookFilter obj = (AddressbookFilter) filter;
      this.fullAccess = obj.isFullAccess();
      this.readonlyAccess = obj.isReadonlyAccess();
      this.abOwner = obj.getOwnerType();
    }
  }

  /**
   * @return the filterType
   */
  public OwnerType getOwnerType()
  {
    return abOwner;
  }

  /**
   * @param calOwner the filterType to set
   * @return this for chaining.
   */
  public AddressbookFilter setOwnerType(final OwnerType calOwner)
  {
    this.abOwner = calOwner;
    return this;
  }

  /**
   * @return true if calOwner == {@link OwnerType#ADMIN}
   */
  public boolean isAdmin()
  {
    return abOwner == OwnerType.ADMIN;
  }

  /**
   * @return true if calOwner == {@link OwnerType#OWN}
   */
  public boolean isAll()
  {
    return abOwner == OwnerType.ALL;
  }

  /**
   * @return true if calOwner == {@link OwnerType#OWN}
   */
  public boolean isOwn()
  {
    return abOwner == OwnerType.OWN;
  }

  /**
   * @return true if calOwner == {@link OwnerType#OTHERS}
   */
  public boolean isOthers()
  {
    return abOwner == OwnerType.OTHERS;
  }

  /**
   * @return the readonlyAccess
   */
  public boolean isReadonlyAccess()
  {
    return readonlyAccess;
  }

  /**
   * @param readonlyAccess the readOnlyAccess to set
   * @return this for chaining.
   */
  public AddressbookFilter setReadonlyAccess(final boolean readonlyAccess)
  {
    this.readonlyAccess = readonlyAccess;
    return this;
  }

  /**
   * @return the fullAccess
   */
  public boolean isFullAccess()
  {
    return fullAccess;
  }

  /**
   * @param fullAccess the fullAccess to set
   * @return this for chaining.
// ... (gekürzt, insgesamt 127 Zeilen)

Git-Verlauf

868d6abb7 2025 -> 2026
63081666f Quellcode-Dateiköpfe: 2024 -> 2025.
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5f7ef41b8 Copyright 2021 -> 2022